Skip to content

Clean up Javadoc warnings and fail the build on new ones#271

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/javadoc-warnings
Jul 12, 2026
Merged

Clean up Javadoc warnings and fail the build on new ones#271
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/javadoc-warnings

Conversation

@vharseko

@vharseko vharseko commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

Makes the Javadoc build produce 0 warnings and turns warnings into hard build errors so regressions cannot slip back in — enforced across the whole JDK matrix (11, 17, 21, 25, 26).

Changes

Warning cleanup + enforcement

  • Remove the deprecated <footer> config in the parent maven-javadoc-plugin setup — it only emitted the JDK -footer option is no longer supported and will be ignored warning (once per module). The <header> already carries the same title, so rendered docs are unchanged.
  • Drop the empty <p></p> in launcher overview.html that produced an empty <p> tag warning.
  • HTML-escape &, <, > in the message text that the i18n AbstractGenerateMessagesMojo embeds into the Javadoc of generated message classes (LDAP filters / HTML fragments would otherwise emit invalid Javadoc in generated sources). The runtime message is still loaded by key from the property bundle, so escaping the doc comment is harmless.
  • Enable failOnWarnings in maven-javadoc-plugin so any remaining Javadoc warning (html, syntax, reference, accessibility) fails the build. The missing doclint group stays suppressed via doclint=all,-missing, so documentation-completeness gaps do not fail the build — only real markup/reference problems do.
  • Bump maven-javadoc-plugin to 3.12.0 (from 3.10.1) and align the two modules that pinned older versions (launcher 2.9, maven-external-dependency-plugin 2.6.1) to the shared ${javadocPluginVersion} property.

JDK 11 doclint: fill in empty block-tag descriptions

  • JDK 11's doclint reports no description for @param/@throws/@return for block tags whose description is empty; JDK 17+ does not report this at all. With failOnWarnings on, that failed the JDK 11 CI jobs while JDK 17+ stayed green.
  • Filled in concise, accurate descriptions for every such tag across the reactor — 370 tags in 90 files, overwhelmingly in the legacy persistit/core module (plus script, audit, json-schema, selfservice, launcher, maven-external-dependency-plugin). Descriptions are derived from each method's signature/body and reuse the module's house wording (e.g. PersistitException -> "if a persistence error occurs").
  • These are comment-only changes — no code, signatures, or behavior touched. (Note: Javadoc prints at most 100 diagnostics per module, so the true count was far higher than the first ~100 visible; a static source scan was used to find and confirm every empty tag.)

Verification

  • Static source scan across the whole reactor: 0 empty block tags remain.
  • mvn javadoc:javadoc on JDK 11 (failOnWarnings=true) -> BUILD SUCCESS, 0 warnings.
  • mvn javadoc:jar (the goal that failed CI) on JDK 11 -> BUILD SUCCESS.
  • mvn javadoc:javadoc on JDK 26 -> BUILD SUCCESS, 0 warnings (confirms the new descriptions introduced no bad HTML/markup).
  • Confirmed failOnWarnings actually bites: injecting an empty <p> / empty tag makes the build fail with Project contains Javadoc Warnings, then reverted.

- Remove the deprecated <footer> config that only emitted the JDK
  "-footer option is no longer supported" warning; the header already
  carries the same title.
- Drop the empty <p></p> in the launcher overview that produced an
  "empty <p> tag" Javadoc warning.
- HTML-escape '&', '<' and '>' in the message text embedded into the
  Javadoc of the i18n-generated message classes so generated sources
  stay warning-free.
- Enable failOnWarnings in maven-javadoc-plugin so any future Javadoc
  warning (html, syntax, reference, accessibility) fails the build.
- Bump maven-javadoc-plugin to 3.12.0 and align the two modules that
  pinned older versions (2.9, 2.6.1) to the shared property.
@vharseko vharseko requested a review from maximthomas July 11, 2026 15:48
@vharseko vharseko added documentation Documentation and Javadoc changes ci Build, CI/CD, JDK matrix and workflow changes dependencies Pull requests that update a dependency file labels Jul 11, 2026
JDK 11's doclint reports "no description for @param/@throws/@return" for
block tags whose description is empty; JDK 17+ does not. With
failOnWarnings enabled this failed the JDK 11 CI jobs. Fill in concise,
accurate descriptions for all such tags across the reactor (mostly
persistit/core) so the Javadoc build is warning-free on every JDK.
Comment-only changes; no code behavior affected.
@vharseko vharseko merged commit 50f78ed into OpenIdentityPlatform:master Jul 12, 2026
38 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Build, CI/CD, JDK matrix and workflow changes dependencies Pull requests that update a dependency file documentation Documentation and Javadoc changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants