0

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.

  1. I can run mvnDebug clean compile from the command line.
  2. I can attach IntelliJ's debugger using a remote debugging target.
  3. My annotation processor runs normally. I've added processingEnv.getMessager().printMessage statements to the process method and I they are logged correctly.
  4. The only thing that is not working is the breakpoints. None of the breakpoints I set are hit.

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?

Radiodef
  • 37,180
  • 14
  • 90
  • 125
user23288
  • 301
  • 2
  • 3

2 Answers2

0

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.

user23288
  • 301
  • 2
  • 3
0

Following issue maybe related. Toolchains is definitely doing something strange when it comes to annotation processing: https://issues.apache.org/jira/browse/MTOOLCHAINS-34

jimhooker2002
  • 1,835
  • 2
  • 12
  • 5