Conversation
* Add a xwiki.compiler.xlint property to xwiki-commons-pom, used for javac's -Xlint option, so that a module can switch off the lint categories it cannot be clean for. Document that it is only meant for modules where that is what we mean, since -Xlint applies to a whole javac invocation and not to a source path * Stop setting the compiler plugin's showDeprecation option: it passed an unconditional -deprecation to javac, which won over any -Xlint:-deprecation set by a module. Deprecation is already part of -Xlint, so nothing else changes * Switch deprecation and dep-ann off in xwiki-commons-repository-model, which contains no hand-written source: the XSD documents 2 elements as deprecated and XJC turns that into a javadoc @deprecated tag without the matching @deprecated annotation, then generates fluent accessors that call the deprecated getters Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 7, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira URL
https://jira.xwiki.org/browse/XCOMMONS-3772
Changes
Description
The build reports 120 javac lint warnings on machine-generated sources across the 3 repos, and none of them can be
fixed since we don't control the generators. This PR is the xwiki-commons part.
xwiki.compiler.xlintproperty toxwiki-commons-pom, used for javac's-Xlintoption, so a module canswitch off the lint categories it cannot be clean for.
showDeprecationoption. It passed an unconditional-deprecationto javac,which won over any
-Xlint:-deprecationa module sets. Deprecation is already part of-Xlint, so this changesnothing else (verified below).
xwiki-commons-repository-modelto switch offdeprecationanddep-ann, removing thatmodule's 8 warnings.
Clarifications
Why the 8 warnings in
xwiki-commons-repository-modelcannot be fixed in the code: the XSD documentsfeatures(deprecated since 8.0M1) and
recommended(deprecated since 16.8.0RC1), and XJC turns that into a javadoc@deprecatedtag without emitting the@Deprecatedannotation. That raises 4dep-annwarnings on thedeclarations, and it also raises 4
deprecationwarnings, because the generated fluent accessors call thedeprecated getters and are not annotated either:
withFeatures()exists only to populate the deprecatedfeatureselement, so there is nothing else it could call,and
featureshas to stay in the XSD because it is part of the Extension Repository REST format. Had XJC annotatedwithFeatures(), javac would have stayed silent, since it does not warn about deprecated use inside deprecatedcode.
That module contains no hand-written Java at all, which is why the module-level property is used here.
-Xlintisa per-javac-invocation option and not a per-source-path one, so for modules that mix generated and hand-written
sources the property must not be used, or the hand-written sources would stop being checked too. Those use a
separate
maven-compiler-pluginexecution instead — see the companion PRs.This applies to every project inheriting the XWiki parent POM, including xwiki-contrib extensions.
Forum proposal (agreement still pending, hence draft):
https://forum.xwiki.org/t/stop-running-javac-lint-checks-on-generated-code/18828
Companion PRs, which need this one merged first since they rely on the new parent POM:
Screenshots & Video
N/A — no visible result, this is a build configuration change.
Executed Tests
Full reactor build, with the Develocity build cache disabled since otherwise
compileis served from cache andreports no javac warnings at all:
BUILD SUCCESS, and diffing the warnings against the same build onmaster:unchecked290,rawtypes256,this-escape66,serial53.showDeprecationloses nothing,xwiki-commons-jakartabridge-servlet(the module with themost deprecation warnings) was diffed line by line: the same 88 warnings before and after.
Expected merging strategy
Prefers squash: Yes. No backport needed.
Generated with Claude Code