Main Tutorials

mvn site : java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent

Generating a Maven report with mvn site, but hits the following errors


java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent

Caused by: java.lang.ClassNotFoundException: org.apache.maven.doxia.siterenderer.DocumentContent

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  28.280 s
[INFO] Finished at: 2018-11-19T13:20:14+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project maven-static-code-analysis: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.3:site failed: A required class was missing while executing org.apache.maven.plugins:maven-site-plugin:3.3:site: org/apache/maven/doxia/siterenderer/DocumentContent
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-site-plugin:3.3

Tested with Maven 3.6.0

Solution

Do not use the default maven-site-plugin:3.3 plugin, upgrade it to the latest version, for example, 3.7.1

pom.xml

	<build>
        <plugins>

            <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>

        </plugins>
    </build>

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
11 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Lorraine Figueroa
5 years ago

This was very helpful. I am following the steps in the online book “Maven By Example” and the “mvn site” was failing because of the above error. The solution worked!

Brian Oxley
3 years ago

Contra an earlier comment I made, this solution works _provided_ the site plugin is set in the <build> section rather than the <reporting> section. I would highlight this point — I scanned the article overly quickly, and did it the wrong way.

Brian Oxley
3 years ago

I’m using maven site plugin 3.9.1, but still seeing the same issue.

Gladson Antony
3 years ago

This was Perfect Solution. Thanks.

Aguilard
3 years ago

Thank you very much,
very help me

ridvan caglar
3 years ago

I was about to hit my monitor, I was trying to figure out this for hours, thank you

Roberto Marquez
4 years ago

thank you sir!

J66
4 years ago

Thanks, Thanks a lot !!!

Giani
4 years ago

Thanks, this helped a lot !

Snake
4 years ago

Thank you so much! You saved my life!

User
4 years ago

Thank you! This is perfect and I wouldn’t have though of it myself!