3

Although there are other answers that cover this in some way, I want to have it for someone else that has similar problem and does notice the solution.

After setting up my own annotation processor and it properly working via maven, I got annoyed by being forced to rebuild source with maven on each change that needs the processor to do some magic.

Setting up eclipse to use my annotation processor required me to close annotation processor project so m2e-apt can put processor jars into .factorypath .

But then it stopped working for some reason, and I could not find the reason,

Davor Hrg
  • 187
  • 1
  • 11

2 Answers2

2

The solution to see the problem was to open:

Window->show view->General->Error Log

After seeing exceptions I was able to fix problems and get it working. This is also the place where you'll see mesages from your processor

Davor Hrg
  • 187
  • 1
  • 11
0

The answer above is correct, but I'd like to put here more details about how to work logging in Eclipse + APT.

Eclipse takes into account only messages send through processingEnv.getMessager().printMessage. If you use printMessage without reference to an element the Eclipse will route your log message to the Workspace Log (Window -> Show view -> General -> Error Log). If you use the printMessage with element reference the Eclipse will route your message to the Problems view (Window -> Show view -> General -> Problems).

If there is some exception during APT rounds Eclipse will log it into the Workspace Log (Window -> Show view -> General -> Error Log)

Eclipse will ignore any other logging methods (e.g. log4j, slf4j, etc).

foal
  • 693
  • 7
  • 20