Repository navigation
Remove use of deprecated MessageUtils - #264
Merged
Merged
Conversation
maven-shared-utils 3.5.0 deprecates org.apache.maven.shared.utils.logging MessageUtils, which now warns at every call site. The suggested replacement is Maven's MessageBuilderFactory, but that requires Maven 3.10.0 (or the org.apache.maven.api.services variant from Maven 4) while this plugin's prerequisite is still Maven 3.6.3, and MessageBuilder itself is deprecated in the same release. So rather than raise prerequisites for a cosmetic feature, drop the styling: the affected messages are now plain text. The messages themselves are unchanged. With style.color=never the output is byte-for-byte identical to before, verified for describe-build-output and for the compare summary and mismatch lines; the .buildinfo/.buildcompare files were never affected. The only difference is that the plugin no longer emits ANSI escape sequences of its own -- Maven's own [INFO]/[ERROR] prefix coloring is untouched. With maven-shared-utils now unused, drop the dependency too, along with its comment noting it existed only for MessageUtils.
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Review effort: Lite
Findings: None
What changed in this PR
Removes deprecated MessageUtils usage while preserving plain-text output and drops the now-unused maven-shared-utils dependency.
Changes:
- Replaces styled output with plain text in both Mojos.
- Removes the unused dependency from
pom.xml.
| File | Description |
|---|---|
| src/main/java/org/apache/maven/plugins/artifact/buildinfo/DescribeBuildOutputMojo.java | Updated as part of this pull request. |
| src/main/java/org/apache/maven/plugins/artifact/buildinfo/CompareMojo.java | Updated as part of this pull request. |
| pom.xml | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
slachiewicz
approved these changes
Sep 28, 2026
|
@elharo Please assign appropriate label to PR according to the type of change. |
Member
|
no, no, no Maven is going in the wrong direction, I don't have time to fight everywhere |
hboutemy
pushed a commit
that referenced
this pull request
Oct 17, 2026
This reverts commit 2600165.
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.
Follow-up to #262, which bumped
maven-shared-utilsfrom 3.4.2 to 3.5.0. That release deprecatesorg.apache.maven.shared.utils.logging.MessageUtils, so the build now warns at every call site.Why not switch to
MessageBuilderFactory?3.5.0's deprecation notice points at
org.apache.maven.message.MessageBuilderFactory, but that API only exists in Maven 3.10.0+, and theorg.apache.maven.api.servicesvariant only in Maven 4. This plugin's prerequisite is still Maven 3.6.3, so adopting either one means a prerequisite bump (or reflection) purely to keep a cosmetic feature.MessageBuilderis itself deprecated in the same release, so it isn't a way out either.So: drop the styling instead of raising prerequisites.
What changed
describe-build-outputandcomparenow emit plain text.maven-shared-utilshad no other use in the plugin — the pom even said<!-- ONLY: MessageUtil -->— so the dependency is dropped as well, taking its transitive Jansi chain with it.Verification
-Dstyle.color=neverthe output is byte-for-byte identical to before. I diffed old vs. new for:describe-build-output, including the header line, the:classifier:extensioncolumn, thetarget/path prefix, and the repository-filename column;comparesummary line, in both its all-matching (N files match) and failing (N files match, N differ) forms;comparemismatch line (... mismatch <file>: investigate with diffoscope ...).-Dstyle.color=alwaysthe only difference is the plugin's own escape sequences disappearing, which is the point. Maven's own[INFO]/[ERROR]prefix coloring is unchanged..buildinfoand.buildcomparefiles are unaffected (they were never styled).mvn clean verify -Prun-its: BUILD SUCCESS, 0 Checkstyle violations, 16/16 ITs pass, nodependency:analyzeproblems.The only remaining deprecation warnings are the two
@Componentones inReproducibleCentralReport, which are fixed by #261 and are not onmasteryet.