maven-site plugins 3.3 java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent
Since this night, maven site 3.3 plugins stop to work.
Try to delete local repository, but no change. Maven 3.3.9 java 1.8
No config or dependencies defined in pom for site plugins
[WARNING] Error injecting: org.apache.maven.report.projectinfo.CiManagementReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent
Solution 1:
I had just started to get this issue also during builds. What worked for me was to specifically define the maven-site-plugin
and the maven-project-info-reports-plugin
along with the version numbers in the pom.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
Solution 2:
This is caused by maven-project-info-reports-plugin
updated to 3.0.0, and rely on doxia-site-renderer
1.8 (and have org.apache.maven.doxia.siterenderer.DocumentContent
this class), but maven-site-plugin:3.3
rely on doxia-site-renderer:1.4
(and do not have org.apache.maven.doxia.siterenderer.DocumentContent
)
We can specific maven-project-info-reports-plugin
version in reporting
part:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</reporting>
Or we can specify maven-site-plugin
to the latest 3.7.1 like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
in build
part of pom.
Solution 3:
Version of the maven site plugin needs to be explicitly set in the build section too. Here is the example:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>licenses</report>
<report>dependency-info</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<!-- Part of Maven - specified version explicitly for compatibility
with the maven-project-info-reports-plugin 3.0.0-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
</plugins>
</build>