apt plugin does not cooperate with others well

Bug #804433 reported by Jan Prach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Consider following pom.xml snipplet. There are two annotation processors. Everything is fine if querydsl is last. However if querydsl is first the other processor (jpamodelgen) won't get executed. I'm not sure why. Perhaps they get chained and querydsl returns bad return code?

btw: there's no error in processing either of the processors

<plugin>
 <groupId>org.bsc.maven</groupId>
 <artifactId>maven-processor-plugin</artifactId>
 <version>2.0.2</version>
 <configuration>
  <processors>
   <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
   <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
  </processors>
 </configuration>
 <dependencies>
  <dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-jpamodelgen</artifactId>
   <version>${hibernate-jpamodelgen.version}</version>
   <scope>compile</scope>
  </dependency>
  <dependency>
   <groupId>com.mysema.querydsl</groupId>
   <artifactId>querydsl-apt</artifactId>
   <version>${querydsl.version}</version>
   <scope>compile</scope>
  </dependency>
 </dependencies>
</plugin>

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Which Querydsl version are you using? Could you provide the part of the Maven log where APT execution happens?

Revision history for this message
Jan Prach (jendap) wrote :

Here's an example. It's even simpler - using compiler plugin instead of additional processor plugin. Run:

mvn clean test

Test will fail. Reordering of annotation processor dependencies helps. Move hibernate-jpamodelgen before querydsl and it will work.

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Fixed in SVN trunk.

The process method needs to return false so that other processors can reclaim the annotations.

Changed in querydsl:
status: New → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Released in 2.2.0

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.