I've written a Java annotation processor following Hannes Dorfmann's tutorial. My project uses Maven. When I try to debug it using mvnDebug
as suggested in this article, everything works except that my breakpoints are not hit in IntelliJ.
mvnDebug clean compile
from the command line.processingEnv.getMessager().printMessage
statements to the process
method and I they are logged correctly.I've tried several things: changing the classpath of the remote debugging target, different versions of maven-compiler-plugin, different options of that plugin (fork, ...), nothing helps.
What am I missing?
The reason is interference or a conflict with the maven-toolchains-plugin
, which is also being used in my project. Once I removed that plugin from the POM, debugging and breakpoints work as expected.
Following issue maybe related. Toolchains is definitely doing something strange when it comes to annotation processing: https://issues.apache.org/jira/browse/MTOOLCHAINS-34
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.