Repository navigation
Encapsulate deprecated MessageUtils usage in private methods - #463
Merged
slawekjaranowski merged 2 commits intoNov 14, 2026
Merged
slawekjaranowski merged 2 commits into
slawekjaranowski merged 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tils-deprecation # Conflicts: # src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
slachiewicz
approved these changes
Nov 14, 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.
MessageUtilsandMessageBuilderfrom maven-shared-utils are deprecated, which produced a number of deprecation warnings during the build.Changes
DescribeMojo: added a privatebuffer()method wrappingMessageUtils.buffer(); all call sites use it now.DescribeMojo: the two places that relied on the deprecatedMessageBuilder.toString()through string concatenation now callbuild()explicitly.EffectivePomMojo: moved the comment coloring logic into a privatecolorizeComments(String)method.@SuppressWarnings("deprecation")and refer to the deprecated classes by fully qualified name. The imports were removed, because a method-level suppression does not cover a deprecation warning reported on an import.The build no longer reports deprecation warnings.
Future migration
The replacement is
org.apache.maven.api.services.MessageBuilderFactory. apache/maven#13917 proposes to ship it in Maven 3.9 and 3.10 as well, so that one plugin binary can use it on 3.9, 3.10 and 4. It is already merged for 3.10.x (apache/maven#13919) but not yet available in 3.9. This plugin requires Maven 3.9.0, so following apache/maven-shared-utils#443 it keeps usingMessageUtilsfor now. Once the prerequisite allows it, only the bodies of these two methods need to be replaced by an injectedMessageBuilderFactory(builder()andisColorEnabled()).🤖 Generated with Claude Code