Conversation
We had all kind of Loggers in Core, some Plexus injected, some acquired using SLF4J LoggerFactory, some static, some final, etc. This PR aligns all those uses to SLF4J finals. Notices: * maven-core does NOT use Plexus Logger anymore * did not touch maven-compat
|
Fails due ancient (1.4!!!) enforcer plugin used in ITs MavenITmng5840RelativePathReactorMatching and MavenITmng5840ParentVersionRanges |
|
This IT change fixes ITs apache/maven-integration-testing#115 |
This is maven4, so breaking change (moved deprecated class) should be okay. Once this merged, we should really un-deprecate mojo Log class.
|
|
||
| public BuilderCommon() | ||
| { | ||
| this.logger = LoggerFactory.getLogger( getClass() ); |
There was a problem hiding this comment.
The ctor is needed for container, look below the 2nd ctor
| */ | ||
| DefaultToolchainManager( Logger logger ) | ||
| { | ||
| this.logger = requireNonNull( logger ); |
There was a problem hiding this comment.
I wonder why UTs need this....
There was a problem hiding this comment.
I did not touch UTs, I merely "cleaned up core logging". Still, added a TODO, as in default toolchain manager (and private) components there are some peculiarities: annotated component should not be extended (is bad practice), so IMO this needs some refactoring...
| */ | ||
| DefaultToolchainManagerPrivate( Logger logger ) | ||
| { | ||
| super( logger ); |
There was a problem hiding this comment.
I did not touch UTs, I merely "cleaned up core logging". Still, added a TODO, as in default toolchain manager (and private) components there are some peculiarities: annotated component should not be extended (is bad practice), so IMO this needs some refactoring...
And moved UT in right package to be able to use pkg private ctor
| @Deprecated //TODO used by the Enforcer plugin (cstamas: not anymore, since 3.0.0) | ||
| public PluginParameterExpressionEvaluator( MavenSession session, MojoExecution mojoExecution, | ||
| PathTranslator pathTranslator, Logger logger, MavenProject project, | ||
| PathTranslator pathTranslator, MavenProject project, |
There was a problem hiding this comment.
This is a breaking change for maven-enforcer-plugin pre 3.0.0... IMO, we should just drop this (long time deprecated) constructor, as 3.x plugins are requirement for a long time, and this is Maven4.
There was a problem hiding this comment.
Will handle this in https://issues.apache.org/jira/browse/MNG-7279 to not mish-mash this PR
| private final Logger logger; | ||
| private final PlexusContainer container; | ||
| private final Logger logger = LoggerFactory.getLogger( getClass() ); | ||
| private final PlexusContainer container; // TODO not used? Then remove |
There was a problem hiding this comment.
This comes from master, container seems unused...
| implements ToolchainManager | ||
| { | ||
| final Logger logger; | ||
| protected final Logger logger; // TODO this class is extended, needs refactoring |
There was a problem hiding this comment.
These two classes DefaultToolchainManager and DefaultToolchainManagerPrivate needs refactor, both has TODOs for it
There was a problem hiding this comment.
Will handle in https://issues.apache.org/jira/browse/MNG-7280
|
Resolve #8159 |
We had all kind of Loggers in Core, some Plexus
injected, some acquired using SLF4J LoggerFactory,
some static, some final, etc.
This PR aligns all those uses to SLF4J finals.
Notices:
https://issues.apache.org/jira/browse/MNG-7278