how do you debug java annotation processors using intellij?

后端 未结 8 948
春和景丽
春和景丽 2020-12-07 13:47

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

8条回答
  •  伪装坚强ぢ
    2020-12-07 14:25

    For a Maven project, this post, which explains the following steps in a little more detail, worked for me:

    1. Add "Remote" run configuration and set "port" to 8000.

    2. Issue the command mvnDebug clean install from the project's directory (on the command line).

    3. 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).

提交回复
热议问题