-
Notifications
You must be signed in to change notification settings - Fork 19
annotation processing not working with JDT / maven-compiler-plugin #22
Comments
When using maven-compiler-plugin for AP, the processing is always delegated to JDT APT in eclipse, so incremental build can be supported. However, JDT APT doesn't support annotation processors from opened workspace projects (see issue #15). As for the out-of-sync issue, please provide a small sample project reproducing the issue (from a github repo for instance) |
I have the same problem, my processor does nor seem to be called. I installed the processor via "mvn install" and closed the project. I configured the dependency in the maven-compiler-plugin
and activated delegating to JDT in eclipse. When I let eclipse build my project I do not see any processor-related output in the maven console nor an error marker in the project's problems view, as I would expect. Can you give me a hint what's awry here? P.S.: Using the processor plugin works, but produces no feasible error marker, just |
I am facing the same issue. Whatever I tried this plugin never triggers my custom APT. At the same time, I have to explicitly state what APT classes that needs to be executed by maven-compiler-plugin because otherwise maven does not pick it up either. I created a CR on the latest maven-compiler-plugin as well since that has been broken since older versions. |
m2e-apt's code is now included in https://github.com/eclipse-m2e/m2e-core , please consider reporting issue to https://github.com/eclipse-m2e/m2e-core/issues if it's still relevant. |
Hi.
I'm using Juno Service Release 2 with JBoss Tools 1.4.0 Final and Maven Integration for Eclipse JDT APT 1.0.1.201209200721 under JDK7 64bit on Windows 7.
I have a multimodule maven build with my own annotation processors defined in two separate modules. Everything is working fine with plain maven build on cmdline and necessary files get generated by the processors under target/generated-sources/annotations as expected on the projects using my custom annotations.
Now I'm using the m2e-apt as described here:
https://community.jboss.org/en/tools/blog/2012/05/20/annotation-processing-support-in-m2e-or-m2e-apt-100-is-out
I'm using the recommended option with the maven-compiler-plugin. Updating maven project configuration and refreshing/rebuilding everything doesn't work for me. No additional target folder "target/generated-sources/annotations" is created and/or added to the eclipse project - even after refreshing. I also added direct dependencies to the annotation processor factories to the pom.xml as described here:
#14 (comment)
Either as "normal" deps and/or plugin deps doesn't do the trick. My annotation processor factories are providing the META-INF/services/javax.annotation.processing.Processor files.
As an alternative I used the 2nd (experimental) maven-processor-plugin option. This seems to work better. The apt folder is added to the eclipse project and files are created as expected. But there is another problem using this option:
Right after saving a file, processing starts and JBoss Tools are publishing the changes to my running JBoss server. But this fails with the "workspace is out of sync..." message refering to the generated files. Seems clear to me, since these files were created/updated outside of eclipse calling maven. Also using the "refresh workspace" option from eclipse preferences doesn't work for me. Maybe the plugin doesn't trigger and automatic workspace refresh after maven has finished its job?!
So neither option one or two works for me. Any hints why the preferred option one using maven-compiler-plugin doesn't work for me?
Thanks.
The text was updated successfully, but these errors were encountered: