How do you debug java annotation processors using intellij?
Preferably using IDEA IntelliJ. I tried setting a breakpoint inside the processor and running but it did
For a Maven project, this post, which explains the following steps in a little more detail, worked for me:
Add "Remote" run configuration and set "port" to 8000.
Issue the command mvnDebug clean install
from the project's directory (on the command line).
Run the run configuration. In order to start a new session after the processes quit, repeat from (2).
Remember to run mvn install
on the project's dependencies when they change (e.g. if the annotation processor is in a different artifact than the project you are debugging it from).
-Dcompiler.process.debug.port=5005
: press Ctrl + Shift + A and select Edit Custom VM Options... in the list of actions to add a custom VM option then restart the IDE.$ ./gradlew --no-daemon -Dorg.gradle.debug=true clean build
(it's okay if the execution of the command is frozen, don't terminate a process).Hope it helps somebody :)