Skip to content

Issue #1038: upgrade maven-checkstyle-plugin to 3.6.0 and exclude dox…#1046

Merged
romani merged 1 commit intocheckstyle:masterfrom
vivek-0509:issue-1038-upgrade-maven-checkstyle-plugin-to-3.6.0
Mar 24, 2026
Merged

Issue #1038: upgrade maven-checkstyle-plugin to 3.6.0 and exclude dox…#1046
romani merged 1 commit intocheckstyle:masterfrom
vivek-0509:issue-1038-upgrade-maven-checkstyle-plugin-to-3.6.0

Conversation

@vivek-0509
Copy link
Copy Markdown
Contributor

Issue #1038

  • Upgraded maven-checkstyle-plugin from 3.1.1 to 3.6.0
  • Excluded doxia-core and doxia-module-xdoc to prevent NoClassDefFoundError caused by doxia version conflict at runtime

@vivek-0509 vivek-0509 force-pushed the issue-1038-upgrade-maven-checkstyle-plugin-to-3.6.0 branch from 2a7966c to 7322e60 Compare March 13, 2026 16:10
@vivek-0509
Copy link
Copy Markdown
Contributor Author

@romani
we are getting this errors

[WARNING] Error injecting: org.apache.maven.plugins.checkstyle.CheckstyleReport
java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent
    at java.lang.Class.getDeclaredConstructors0 (Native Method)


R] urls[36] = file:/C:/Users/appveyor/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
[ERROR] urls[37] = file:/C:/Users/appveyor/.m2/repository/org/apache/maven/doxia/doxia-decoration-model/1.4/doxia-decoration-model-1.4.jar
[ERROR] urls[38] = file:/C:/Users/appveyor/.m2/repository/org/apache/maven/doxia/doxia-site-renderer/1.4/doxia-site-renderer-1.4.jar

we also need to update the maven-site-plugin to the latest version
Should i update it in the same PR??

@romani
Copy link
Copy Markdown
Member

romani commented Mar 15, 2026

hmm, this is wild .... I would expect that plugin will use its own dependency to Doxia

@vivek-0509
Copy link
Copy Markdown
Contributor Author

vivek-0509 commented Mar 16, 2026

i expect the same, let me test my reasoning once

@vivek-0509 vivek-0509 force-pushed the issue-1038-upgrade-maven-checkstyle-plugin-to-3.6.0 branch from 7322e60 to e243cc8 Compare March 16, 2026 12:35
@vivek-0509 vivek-0509 force-pushed the issue-1038-upgrade-maven-checkstyle-plugin-to-3.6.0 branch from e243cc8 to bc1dc19 Compare March 16, 2026 15:09
@vivek-0509
Copy link
Copy Markdown
Contributor Author

@romani
CI was failing because maven-checkstyle-plugin:3.6.0 requires doxia-site-renderer:2.0.0, but the actual maven-site-plugin running mvn site is still 3.3 (which ships with doxia-site-renderer:1.4).

The maven-site-plugin:3.3 in does NOT control which version runs the build. The actual execution version comes from Maven's hardcoded site lifecycle bindings, which defaults to 3.3:

site org.apache.maven.plugins:maven-site-plugin:3.3:site
site-deploy org.apache.maven.plugins:maven-site-plugin:3.3:deploy
reference:Maven 3.8.8 Lifecycles Reference

The CI log confirms this, even with 3.21.0 in , the build still uses 3.3

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project sample: 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

[INFO] configuring report plugin org.apache.maven.plugins:maven-site-plugin:3.21.0

report plugins run inside the site plugin's ClassRealm, so maven-checkstyle-plugin:3.6.0 cannot bring its own doxia-site-renderer, it must use whatever the site plugin provides. With 3.3, only doxia-site-renderer:1.4 is available, which doesn't have DocumentContent so we are gettiing NoClassDefFoundError.

i have added maven-site-plugin:3.21.0 in to override Maven's hardcoded default. This is the only place that controls the actual execution version.

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good !

@romani romani merged commit e8d348a into checkstyle:master Mar 24, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants