SBT (Simple build tool)

This is a build tool that builds your scala project which involves downloading all the dependencies mentioned in your scala project file.

Debugging Scala SBT with intellij :

At the command line, start sbt :
> sbt

then, in sbt shell:

> project <project name in build.scala file>
[info] Set current project to <projectname>
re-start — -Dbuild.env=<envName> -Dconfig.file=<config_file_loc> –Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005

[info] Application <project> not yet started
[info] Starting application <project> in the background …
<proj> Starting <project_path>.main()
[success] Total time: 1 s
> <proj> Listening for transport dt_socket at address: 5005

Go back to IntelliJ, and in Run->edit configurations->Remote click the + to create a copy
then edit that copy to give it a name
Put the address from above (here 5005) into that for the port. Click ok to save it, then Run->Debug <name you chose> should attach to the session (IntelliJ calls it a Frame)
make sure to set a break point which will get hit. Use Postman to send the appropriate request to kick it off

 

Leave a comment