Community
Participate
Working Groups
Build Identifier: 20100617-1415 In a project which is AJDT configured, and Annotation Processing is enabled, Annotation Processing does not work. I used Eclipse 3.6 Helios, AJDT 2.1 (Version: 2.1.0.e36x-release-20100630-1500 AspectJ version: 1.6.9.20100629172100) and Hibernate Model Generator 1.0.0.Final. If I turn of AJDT, Annotation Processing works fine. Reproducible: Always Steps to Reproduce: 1. Turn on AJDT 2. Enable Annotation Processing for the project for JPA2 Static Metamodel generation with Hibernate Model Generator. 3. Create a Entity Model Class with @Id and other fields. 4. Static Metamodel class is not generated.
Possibly AJDT has a compilationParticipant that is not playing well with others?
When you say "turn AJDT on", do you mean that you are enabling AspectJ support for a single project? If so, does annotation processing work for non-aspectj projects? AspectJ projects do not use the JDT builder, and so things behave slightly differently in some situations when in an AspectJ project vs a pure Java one. I do not know how annotation processing is invoked and it may be that it is invoked by the Java builder and not the AJ builder.
Looks to be a dup of: https://bugs.eclipse.org/bugs/show_bug.cgi?id=169857 "Enabling AspectJ on project disables APT processing" Comment 6 in that bug suggests a possible workaround of listing both the java builder and ajbuilder - I imagine that will trigger the apt stuff to run, but I can't guarantee the behaviour of the compilation that follows it.
Thanks for catching that, Andy. It is a duplicate. *** This bug has been marked as a duplicate of bug 169857 ***
Ah, that makes sense. Yes, annotation processing (APT) is run from the Java builder, via an org.eclipse.jdt.core extension point called compilationParticipant, which is called during the Java compilation process. If AJDT is not using the Java builder, then it is not going to get APT.