slachiewicz opened a new pull request, #13918:
URL: https://github.com/apache/maven/pull/13918

   Plugins could not use the `MessageBuilderFactory` Maven 3.10 introduced, and 
when Maven injected it the result never had colours.
   
   - Core exports `org.apache.maven.*`, and classworlds matches a `.*` entry 
for that exact package only, so `org.apache.maven.message` was not visible to 
plugins: a mojo injecting `org.apache.maven.message.MessageBuilderFactory` 
fails on 3.10.0 with `NoClassDefFoundError`. Core now also exports 
`org.apache.maven.message.*`; `org.apache.maven.message.internal` stays private.
   - `JLineMessageBuilderFactory` was in no Sisu index, so every injection got 
`DefaultMessageBuilderFactory`, which never colours. `maven-jline` now 
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=never` or 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 gets 
`JLineMessageBuilderFactory` on the built distribution, with colours under 
`--color=always` and a pseudo-terminal and none when piped or with 
`--color=never`.
   
   Part of #13917.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to