how do you debug java annotation processors using intellij?

后端 未结 8 943
春和景丽
春和景丽 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:20

    Annotation processing occurs during compilation, so normal debugging won't work. If you want to debug it in the context of you project, you can use IntelliJ remote debugging, while having Gradle or Maven in debug mode. Then you can put breakpoints in the Annotation Processor's files.

    See Debugging an Annotation Processor in any project.

    Disclaimer: I wrote the post.

提交回复
热议问题