doc/debug.md
Remote debug flags (-Xdebug, -Xrunjdwp) are already configured in
build.sbt Container / javaOptions. No manual build.sbt setup needed.
./sbt "~Container / start"
Wait for Listening for transport dt_socket at address: 8000 to appear.
In IntelliJ, create remote debug configuration as follows:
localhost, Port = 8000gitbucket.mainSet a breakpoint (e.g., line 83 in src/main/scala/gitbucket/core/controller/ApiController.scala), then trigger the endpoint:
curl http://localhost:8080/api/v3
IntelliJ's source mapping is out of sync. Fix:
./sbt "~Container / start"May need to disconnect/reconnect debugger 1-2 times for frames to appear.
A previous debug session didn't clean up. Kill the process:
lsof -ti:8000 | xargs kill -9
Then restart sbt.
Ensure code was compiled after debugger attached. Edit the source file (add/remove a blank line) to trigger recompilation, then retry the request.
Remote debug flags are always present in build.sbt Container / javaOptions.
To disable, comment out the -Xdebug and -Xrunjdwp lines there and restart sbt.