Tuesday, 15 January 2013

When building a Maven site, why does my annotation processor run twice and break the build? -



When building a Maven site, why does my annotation processor run twice and break the build? -

i have build uses annotation processor plugin generate jpa criteria classes hibernate jpa 2 metamodel generator.

this works when doing normal mvn clean package, when build site, fails:

[info] --- maven-processor-plugin:2.1.0:process (generate-jpa-metamodel) @ phtool-api --- [info] source directory: c:\jp\esv-projects\phtool\phtool-api\target\generated-sources\jpa added [info] javac option: -cp [info] javac option: ... [info] javac option: -proc:only [info] javac option: -processor [info] javac option: org.hibernate.jpamodelgen.jpametamodelentityprocessor [info] javac option: -d [info] javac option: c:\jp\esv-projects\phtool\phtool-api\target\classes [info] javac option: -s [info] javac option: c:\jp\esv-projects\phtool\phtool-api\target\generated-sources\jpa [info] diagnostic note: hibernate jpa 2 static-metamodel generator 1.2.0.final [info] diagnostic c:\jp\projects\phtool\phtool-api\target\generated-sources\jpa\phtool\impl\resource\imageimpl_.java:10: error: duplicate c lass: phtool.impl.resource.imageimpl_

i noticed plugin runs twice during site generation, don't know why. perhaps it's known javadoc plugin bug?

the problem solved now, through changes in parent pom. can't tell alter solved problem, here relevant versions within pom:

<groupid>org.bsc.maven</groupid> <artifactid>maven-processor-plugin</artifactid> <version>2.2.4</version> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-site-plugin</artifactid> <version>3.3</version> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> <version>2.9</version>

note version of javadoc plugin hasn't changed!

maven maven-site-plugin

No comments:

Post a Comment