Debugging Sbt Tasks in Intellij
Debugging Sbt Tasks in Intellij
I was so lost doing this and almost reverted to print statements :O
But I didn’t, here’s how I got it to work.
Edit Configs
In the top right corner of the Intellij window is a drop down. Click this and select ‘Edit Configurations’
Add a new remote section using the ‘+’ in the top left:
Take note of the settings section (its the only really important one for now)
Save the debug settings
Launch SBT in debug mode
Open a terminal and start sbt in debug mode:
sbt -jvm-debug 5005
Run the debugger
Click on the Green bug next to ‘Edit Configurations’ from before
Set breakpoints and run
Set a break point in the code and run with the sbt ‘test’ command