When creating a Maven site, why does my annotation engine run twice and interrupt the build?

I have an assembly that uses the annotation processor plugin to create JPA criteria classes with the Hibernate JPA 2 metamodel generator .

This works well when running the normal mvn clean package , but when I create the site, it 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 that the plugin runs twice during the creation of the site, but I do not know why. Perhaps this is a known Javadoc plugin bug ?

+4
source share
1 answer

Now the problem is solved by changing the parent POM. I can’t say exactly what changes solved the problem, but here are the corresponding versions in my 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> 

Please note that the Javadoc plugin version has not changed!

0
source

All Articles