diff --git a/src/config/checkstyle-suppressions.xml b/src/config/checkstyle-suppressions.xml
index 308814ec..ed960fd6 100644
--- a/src/config/checkstyle-suppressions.xml
+++ b/src/config/checkstyle-suppressions.xml
@@ -22,5 +22,5 @@ under the License.
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
-
+
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
index 588372c9..bd306688 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
@@ -52,13 +52,14 @@
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.model.Resource;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.resource.ResourceManager;
import org.codehaus.plexus.resource.loader.FileResourceCreationException;
import org.codehaus.plexus.resource.loader.FileResourceLoader;
import org.codehaus.plexus.resource.loader.ResourceNotFoundException;
import org.codehaus.plexus.util.FileUtils;
import org.eclipse.sisu.Typed;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Olivier Lamy
@@ -66,7 +67,10 @@
*/
@Named
@Typed(CheckstyleExecutor.class)
-public class DefaultCheckstyleExecutor extends AbstractLogEnabled implements CheckstyleExecutor {
+public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
+
+ private static final Logger logger = LoggerFactory.getLogger(DefaultCheckstyleExecutor.class);
+
private final ResourceManager locator;
private final ResourceManager licenseLocator;
@@ -81,8 +85,8 @@ public DefaultCheckstyleExecutor(
@Override
public CheckstyleResults executeCheckstyle(CheckstyleExecutorRequest request)
throws CheckstyleExecutorException, CheckstyleException {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("executeCheckstyle start headerLocation : " + request.getHeaderLocation());
+ if (logger.isDebugEnabled()) {
+ logger.debug("executeCheckstyle start headerLocation : " + request.getHeaderLocation());
}
MavenProject project = request.getProject();
@@ -220,7 +224,7 @@ public CheckstyleResults executeCheckstyle(CheckstyleExecutorRequest request)
// work regardless of config), but should record this information
throw new CheckstyleExecutorException(message.toString());
} else {
- getLogger().info(message.toString());
+ logger.info(message.toString());
}
}
@@ -255,8 +259,7 @@ protected void addSourceDirectory(
File resourcesDirectory = new File(resource.getDirectory());
if (resourcesDirectory.exists() && resourcesDirectory.isDirectory()) {
sinkListener.addSourceDirectory(resourcesDirectory);
- getLogger()
- .debug("Added '" + resourcesDirectory.getAbsolutePath() + "' as a source directory.");
+ logger.debug("Added '" + resourcesDirectory.getAbsolutePath() + "' as a source directory.");
}
}
}
@@ -286,9 +289,8 @@ public Configuration getConfiguration(CheckstyleExecutorRequest request) throws
: System.getProperty("file.encoding", "UTF-8");
if (StringUtils.isEmpty(request.getEncoding())) {
- getLogger()
- .warn("File encoding has not been set, using platform encoding " + effectiveEncoding
- + ", i.e. build is platform dependent!");
+ logger.warn("File encoding has not been set, using platform encoding " + effectiveEncoding
+ + ", i.e. build is platform dependent!");
}
if ("Checker".equals(config.getName())
@@ -298,7 +300,7 @@ public Configuration getConfiguration(CheckstyleExecutorRequest request) throws
addAttributeIfNotExists((DefaultConfiguration) config, "charset", effectiveEncoding);
addAttributeIfNotExists((DefaultConfiguration) config, "cacheFile", request.getCacheFile());
} else {
- getLogger().warn("Failed to configure file encoding on module " + config);
+ logger.warn("Failed to configure file encoding on module " + config);
}
}
return config;
@@ -368,8 +370,8 @@ private Properties getOverridingProperties(CheckstyleExecutorRequest request) th
Properties p = new Properties();
try {
if (request.getPropertiesLocation() != null) {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("request.getPropertiesLocation() " + request.getPropertiesLocation());
+ if (logger.isDebugEnabled()) {
+ logger.debug("request.getPropertiesLocation() " + request.getPropertiesLocation());
}
File propertiesFile =
@@ -399,8 +401,8 @@ private Properties getOverridingProperties(CheckstyleExecutorRequest request) th
headerLocation = "config/maven-header.txt";
}
}
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("headerLocation " + headerLocation);
+ if (logger.isDebugEnabled()) {
+ logger.debug("headerLocation " + headerLocation);
}
if (headerLocation != null && !headerLocation.isEmpty()) {
@@ -411,8 +413,8 @@ private Properties getOverridingProperties(CheckstyleExecutorRequest request) th
p.setProperty("checkstyle.header.file", headerFile.getAbsolutePath());
}
} catch (FileResourceCreationException | ResourceNotFoundException e) {
- getLogger().debug("Unable to process header location: " + headerLocation);
- getLogger().debug("Checkstyle will throw exception if ${checkstyle.header.file} is used");
+ logger.debug("Unable to process header location: " + headerLocation);
+ logger.debug("Checkstyle will throw exception if ${checkstyle.header.file} is used");
}
}
@@ -486,7 +488,7 @@ private List getFilesToProcess(CheckstyleExecutorRequest request) throws I
request.getTestSourceDirectories());
}
- getLogger().debug("Added " + files.size() + " files to process.");
+ logger.debug("Added " + files.size() + " files to process.");
return new ArrayList<>(files);
}
@@ -505,9 +507,8 @@ private void addFilesToProcess(
final List sourceFiles =
FileUtils.getFiles(sourceDirectory, request.getIncludes(), request.getExcludes());
files.addAll(sourceFiles);
- getLogger()
- .debug("Added " + sourceFiles.size() + " source files found in '"
- + sourceDirectory.getAbsolutePath() + "'.");
+ logger.debug("Added " + sourceFiles.size() + " source files found in '"
+ + sourceDirectory.getAbsolutePath() + "'.");
}
}
}
@@ -519,9 +520,8 @@ private void addFilesToProcess(
FileUtils.getFiles(testSourceDirectory, request.getIncludes(), request.getExcludes());
files.addAll(testSourceFiles);
- getLogger()
- .debug("Added " + testSourceFiles.size() + " test source files found in '"
- + testSourceDirectory.getAbsolutePath() + "'.");
+ logger.debug("Added " + testSourceFiles.size() + " test source files found in '"
+ + testSourceDirectory.getAbsolutePath() + "'.");
}
}
}
@@ -529,13 +529,13 @@ private void addFilesToProcess(
if (resources != null && request.isIncludeResources()) {
addResourceFilesToProcess(request, resources, files);
} else {
- getLogger().debug("No resources found in this project.");
+ logger.debug("No resources found in this project.");
}
if (testResources != null && request.isIncludeTestResources()) {
addResourceFilesToProcess(request, testResources, files);
} else {
- getLogger().debug("No test resources found in this project.");
+ logger.debug("No test resources found in this project.");
}
}
@@ -569,13 +569,11 @@ private void addResourceFilesToProcess(
List resourceFiles = FileUtils.getFiles(resourcesDirectory, includes, excludes);
files.addAll(resourceFiles);
- getLogger()
- .debug("Added " + resourceFiles.size() + " resource files found in '"
- + resourcesDirectory.getAbsolutePath() + "'.");
+ logger.debug("Added " + resourceFiles.size() + " resource files found in '"
+ + resourcesDirectory.getAbsolutePath() + "'.");
} else {
- getLogger()
- .debug("The resources directory '" + resourcesDirectory.getAbsolutePath()
- + "' does not exist or is not a directory.");
+ logger.debug("The resources directory '" + resourcesDirectory.getAbsolutePath()
+ + "' does not exist or is not a directory.");
}
}
}
@@ -613,8 +611,8 @@ private String getSuppressionsFilePath(final CheckstyleExecutorRequest request)
private String getConfigFile(CheckstyleExecutorRequest request) throws CheckstyleExecutorException {
try {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("request.getConfigLocation() " + request.getConfigLocation());
+ if (logger.isDebugEnabled()) {
+ logger.debug("request.getConfigLocation() " + request.getConfigLocation());
}
File configFile = locator.getResourceAsFile(request.getConfigLocation(), "checkstyle-checker.xml");