Repository navigation
[maven-3.10.x] Let plugins use MessageBuilderFactory with colours - #13918
Closed
slachiewicz wants to merge 1 commit into
Closed
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
Plugins could not load org.apache.maven.message: the core export org.apache.maven.* matches only that package itself, not its subpackages. And JLineMessageBuilderFactory was in no Sisu index, so everything that injected a MessageBuilderFactory got the uncoloured default.
slawekjaranowski
approved these changes
Nov 9, 2026
slachiewicz
marked this pull request as ready for review
November 9, 2026 15:35
Member
Author
|
Folded into #13919: instead of exporting |
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.
Plugins could not use the
MessageBuilderFactoryMaven 3.10 introduced, and when Maven injected it the result never had colours.org.apache.maven.*, and classworlds matches a.*entry for that exact package only, soorg.apache.maven.messagewas not visible to plugins: a mojo injectingorg.apache.maven.message.MessageBuilderFactoryfails on 3.10.0 withNoClassDefFoundError. Core now also exportsorg.apache.maven.message.*;org.apache.maven.message.internalstays private.JLineMessageBuilderFactorywas in no Sisu index, so every injection gotDefaultMessageBuilderFactory, which never colours.maven-jlinenow generates its index, and its@Priority(10)factory wins.Behaviour change: Maven's own messages built through the injected factory (
MojoExecutor,LifecycleDependencyResolver,DeprecatedPluginValidator,DefaultMojoExecutionConfigurator,LifecycleExecutionException) are now coloured on a terminal, like the rest of the output; with-B,-l,--color=neveror piped output they stay plain.Verified:
mvn verify -pl maven-jline,maven-core,maven-embedder→ 10, 429 and 55 tests pass; a mojo injecting the 3.10 factory getsJLineMessageBuilderFactoryon the built distribution, with colours under--color=alwaysand a pseudo-terminal and none when piped or with--color=never.Part of #13917.