diff --git a/maven-core/src/main/java/org/apache/maven/project/collector/MultiModuleCollectionStrategy.java b/maven-core/src/main/java/org/apache/maven/project/collector/MultiModuleCollectionStrategy.java index 88c1b8c673..4d4413ebb4 100644 --- a/maven-core/src/main/java/org/apache/maven/project/collector/MultiModuleCollectionStrategy.java +++ b/maven-core/src/main/java/org/apache/maven/project/collector/MultiModuleCollectionStrategy.java @@ -50,7 +50,7 @@ @Singleton public class MultiModuleCollectionStrategy implements ProjectCollectionStrategy { - private final Logger logger = LoggerFactory.getLogger( getClass() ); + private static final Logger LOGGER = LoggerFactory.getLogger( MultiModuleCollectionStrategy.class ); private final ModelLocator modelLocator; private final ProjectsSelector projectsSelector; @@ -76,7 +76,7 @@ public List collectProjects( MavenExecutionRequest request ) throw } else { - logger.debug( "Multi module project collection failed:{}" + LOGGER.debug( "Multi module project collection failed:{}" + "Detected a POM file next to a .mvn folder in a parent directory ({}). " + "Maven assumed that POM file to be the parent of the requested project ({}), but it turned " + "out that it was not. Another project collection strategy will be executed as result.", @@ -91,7 +91,7 @@ public List collectProjects( MavenExecutionRequest request ) throw if ( fallThrough ) { - logger.debug( "Multi module project collection failed:{}" + LOGGER.debug( "Multi module project collection failed:{}" + "Detected that one of the modules of this multi module project uses another module as " + "plugin extension which still needed to be built. This is not possible within the same " + "reactor build. Another project collection strategy will be executed as result.", @@ -114,10 +114,10 @@ private File getMultiModuleProjectPomFile( MavenExecutionRequest request ) File multiModuleProjectPom = modelLocator.locatePom( request.getMultiModuleProjectDirectory() ); if ( !multiModuleProjectPom.exists() ) { - logger.info( "Maven detected that the requested POM file is part of a multi module project, " + LOGGER.info( "Maven detected that the requested POM file is part of a multi module project, " + "but could not find a pom.xml file in the multi module root directory '{}'.", request.getMultiModuleProjectDirectory() ); - logger.info( "The reactor is limited to all projects under: " + request.getPom().getParent() ); + LOGGER.info( "The reactor is limited to all projects under: " + request.getPom().getParent() ); return request.getPom(); } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java index f57d78233e..5197f32002 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/configuration/SettingsXmlConfigurationProcessor.java @@ -71,7 +71,7 @@ public class SettingsXmlConfigurationProcessor public static final File DEFAULT_GLOBAL_SETTINGS_FILE = new File( System.getProperty( "maven.conf" ), "settings.xml" ); - private final Logger logger = LoggerFactory.getLogger( SettingsXmlConfigurationProcessor.class ); + private static final Logger LOGGER = LoggerFactory.getLogger( SettingsXmlConfigurationProcessor.class ); @Inject private SettingsBuilder settingsBuilder; @@ -137,9 +137,9 @@ public void process( CliRequest cliRequest ) request.getEventSpyDispatcher().onEvent( settingsRequest ); } - logger.debug( "Reading global settings from '{}'", + LOGGER.debug( "Reading global settings from '{}'", getLocation( settingsRequest.getGlobalSettingsSource(), settingsRequest.getGlobalSettingsFile() ) ); - logger.debug( "Reading user settings from '{}'", + LOGGER.debug( "Reading user settings from '{}'", getLocation( settingsRequest.getUserSettingsSource(), settingsRequest.getUserSettingsFile() ) ); SettingsBuildingResult settingsResult = settingsBuilder.build( settingsRequest ); @@ -151,16 +151,16 @@ public void process( CliRequest cliRequest ) populateFromSettings( request, settingsResult.getEffectiveSettings() ); - if ( !settingsResult.getProblems().isEmpty() && logger.isWarnEnabled() ) + if ( !settingsResult.getProblems().isEmpty() && LOGGER.isWarnEnabled() ) { - logger.warn( "" ); - logger.warn( "Some problems were encountered while building the effective settings" ); + LOGGER.warn( "" ); + LOGGER.warn( "Some problems were encountered while building the effective settings" ); for ( SettingsProblem problem : settingsResult.getProblems() ) { - logger.warn( "{} @ {}", problem.getMessage(), problem.getLocation() ); + LOGGER.warn( "{} @ {}", problem.getMessage(), problem.getLocation() ); } - logger.warn( "" ); + LOGGER.warn( "" ); } } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java index 33e9920ee6..33c47c2210 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/BaseSlf4jConfiguration.java @@ -31,15 +31,15 @@ public class BaseSlf4jConfiguration implements Slf4jConfiguration { - private final Logger logger = LoggerFactory.getLogger( BaseSlf4jConfiguration.class ); + private static final Logger LOGGER = LoggerFactory.getLogger( BaseSlf4jConfiguration.class ); public void setRootLoggerLevel( Level level ) { - logger.warn( "setRootLoggerLevel: operation not supported" ); + LOGGER.warn( "setRootLoggerLevel: operation not supported" ); } public void activate() { - logger.warn( "reset(): operation not supported" ); + LOGGER.warn( "reset(): operation not supported" ); } } diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java index 222ab4d3f0..077c674f06 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java @@ -36,7 +36,7 @@ public class UnsupportedSlf4jBindingConfiguration extends BaseSlf4jConfiguration { - private final Logger logger = LoggerFactory.getLogger( UnsupportedSlf4jBindingConfiguration.class ); + private static final Logger LOGGER = LoggerFactory.getLogger( UnsupportedSlf4jBindingConfiguration.class ); private String slf4jBinding; @@ -51,8 +51,8 @@ public UnsupportedSlf4jBindingConfiguration( String slf4jBinding, Map