Skip to content

docletPath with relative path resolves incorrectly causing AssertionE…#1313

Merged
slachiewicz merged 1 commit intoapache:masterfrom
martinaldrin:docletPath_jdk25
Apr 16, 2026
Merged

docletPath with relative path resolves incorrectly causing AssertionE…#1313
slachiewicz merged 1 commit intoapache:masterfrom
martinaldrin:docletPath_jdk25

Conversation

@martinaldrin
Copy link
Copy Markdown
Contributor

with a relative path is written verbatim to the javadoc options file. The javadoc tool runs from target/reports/testapidocs, so a relative path like target/test-classes resolves to
target/reports/testapidocs/target/test-classes — which doesn't exist. This causes the wrong class to be loaded from the classpath, which on Java 25 triggers a fatal assertion error:

error: fatal error encountered: java.lang.AssertionError: ignored flag: -Xlint:-options

On Java 21 and earlier the wrong class was silently loaded without crashing.

Fix: In AbstractJavadocMojo.getDocletPath(), resolve docletPath entries through JavadocUtil.prunePaths() (which resolves relative paths against project.getBasedir()) instead of passing them verbatim via
unifyPathSeparator(). This is consistent with how other path parameters are already handled.

Note: testJavadocResourcesWithExcludes fails on a second consecutive mvn verify without clean due to a pre-existing stale data/test isolation issue in the suite — unrelated to this fix. mvn clean verify passes.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Checklist status:

  • ✅ Addresses one issue only
  • ✅ Unit test added: JavadocUtilTest.testPrunePathsResolvesRelativePaths() — fails without the fix, passes with it
  • ✅ mvn clean verify passes
  • ⚠️ Integration tests (mvn -Prun-its verify) — please indicate if you've run these
  • ✅ ~10 lines of code change — no ICLA required
  • ✅ Licensed under Apache License 2.0

@slachiewicz slachiewicz added the bug Something isn't working label Apr 5, 2026
@martinaldrin
Copy link
Copy Markdown
Contributor Author

@slachiewicz I guess the failure is not related to my commit, saw similar failure on other PRs as well

@slachiewicz slachiewicz merged commit 51d884d into apache:master Apr 16, 2026
2 of 3 checks passed
@github-actions github-actions bot added this to the 3.12.1 milestone Apr 16, 2026
@martinaldrin
Copy link
Copy Markdown
Contributor Author

@slachiewicz is there any plan for a new release in coming weeks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants