0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[メモ] Intelli Jでsbtタスク(scalaサーバ)をデバッグ実行する

Last updated at Posted at 2024-09-17

やり方(1)

sbtシェルを起動しAttach debugger to sbt shellを実行する。

image.png

以下のように、DebuggerコンソールでConnected to the target VM, address: 'localhost:57356', transport: 'socket'と表示されるのが確認できる。

image.png

なお、これはポート番号は以下のようにconfigに設定されている。

image.png

自分の場合、やり方(1)だとブレークポイントで実行が停止しなかった。
おそらく、scalaサーバーがメインプロセス(orスレッド)からフォークされたプロセス(orスレッド)で実行されていたからであろう。以下のやり方(2)だとうまくいった。

やり方(2)

コードの左端で Debug MyServerをクリックしてサーバーを起動することもできた。

image.png

sbt shell内でサーバーが起動されているのが確認できた。

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?