diff --git a/src/it/MCHECKSTYLE-432/invoker.properties b/src/it/MCHECKSTYLE-432/invoker.properties
new file mode 100644
index 00000000..fe48ca13
--- /dev/null
+++ b/src/it/MCHECKSTYLE-432/invoker.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+invoker.goals=clean site
diff --git a/src/it/MCHECKSTYLE-432/pom.xml b/src/it/MCHECKSTYLE-432/pom.xml
new file mode 100644
index 00000000..8afe9a79
--- /dev/null
+++ b/src/it/MCHECKSTYLE-432/pom.xml
@@ -0,0 +1,90 @@
+
+
+
+
+ 4.0.0
+
+ org.apache.maven.plugins.checkstyle.its
+ MCHECKSTYLE-432
+ 1.0-SNAPSHOT
+
+ https://issues.apache.org/jira/browse/MCHECKSTYLE-432
+
+
+ UTF-8
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ @project.version@
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ check
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-site-plugin
+ @sitePluginVersion@
+
+ default,fr,de
+
+
+
+
+ attach-descriptor
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ @project.version@
+
+
+
+
diff --git a/src/it/MCHECKSTYLE-432/src/main/java/org/MyClass.java b/src/it/MCHECKSTYLE-432/src/main/java/org/MyClass.java
new file mode 100644
index 00000000..84a40d38
--- /dev/null
+++ b/src/it/MCHECKSTYLE-432/src/main/java/org/MyClass.java
@@ -0,0 +1,26 @@
+package org;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Yada yada yada.
+ */
+public class MyClass {
+}
diff --git a/src/it/MCHECKSTYLE-432/src/main/java/org/package.html b/src/it/MCHECKSTYLE-432/src/main/java/org/package.html
new file mode 100644
index 00000000..c66f6f2e
--- /dev/null
+++ b/src/it/MCHECKSTYLE-432/src/main/java/org/package.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
index 16721aa0..f6e4d66c 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
@@ -493,6 +493,7 @@ public void executeReport( Locale locale )
// locator = new Locator( new MojoLogMonitorAdaptor( getLog() ) );
// locator = new Locator( getLog(), new File( project.getBuild().getDirectory() ) );
+ String effectiveConfigLocation = configLocation;
if ( checkstyleRules != null )
{
if ( !DEFAULT_CONFIG_LOCATION.equals( configLocation ) )
@@ -515,7 +516,7 @@ public void executeReport( Locale locale )
{
throw new MavenReportException( e.getMessage(), e );
}
- configLocation = rulesFiles.getAbsolutePath();
+ effectiveConfigLocation = rulesFiles.getAbsolutePath();
}
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
@@ -523,13 +524,14 @@ public void executeReport( Locale locale )
{
CheckstyleExecutorRequest request = createRequest().setLicenseArtifacts( collectArtifacts( "license" ) )
.setConfigurationArtifacts( collectArtifacts( "configuration" ) )
- .setOmitIgnoredModules( omitIgnoredModules );
+ .setOmitIgnoredModules( omitIgnoredModules )
+ .setConfigLocation( effectiveConfigLocation );
CheckstyleResults results = checkstyleExecutor.executeCheckstyle( request );
ResourceBundle bundle = getBundle( locale );
generateReportStatics();
- generateMainReport( results, bundle );
+ generateMainReport( results, bundle, effectiveConfigLocation );
if ( enableRSS )
{
CheckstyleRssGeneratorRequest checkstyleRssGeneratorRequest =
@@ -725,7 +727,7 @@ private String getCopyright()
return copyright;
}
- private void generateMainReport( CheckstyleResults results, ResourceBundle bundle )
+ private void generateMainReport( CheckstyleResults results, ResourceBundle bundle, String configLocation )
{
CheckstyleReportGenerator generator =
new CheckstyleReportGenerator( getSink(), bundle, project.getBasedir(), siteTool, configLocation );
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java
index dee6f64d..6d9b3813 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleAggregateReport.java
@@ -73,7 +73,7 @@ protected CheckstyleExecutorRequest createRequest()
.setProject( project ).setSourceDirectories( getSourceDirectories() )
.setResources( resources ).setTestResources( testResources )
.setStringOutputStream( stringOutputStream ).setSuppressionsLocation( suppressionsLocation )
- .setTestSourceDirectories( getTestSourceDirectories() ).setConfigLocation( configLocation )
+ .setTestSourceDirectories( getTestSourceDirectories() )
.setPropertyExpansion( propertyExpansion ).setHeaderLocation( headerLocation )
.setCacheFile( cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression )
.setEncoding( getInputEncoding() ).setPropertiesLocation( propertiesLocation );
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java
index 0d3af2d2..c7424219 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReport.java
@@ -66,7 +66,7 @@ protected CheckstyleExecutorRequest createRequest()
.setProject( project ).setSourceDirectories( getSourceDirectories() )
.setResources( resources )
.setStringOutputStream( stringOutputStream ).setSuppressionsLocation( suppressionsLocation )
- .setTestSourceDirectories( getTestSourceDirectories() ).setConfigLocation( configLocation )
+ .setTestSourceDirectories( getTestSourceDirectories() )
.setPropertyExpansion( propertyExpansion ).setHeaderLocation( headerLocation )
.setCacheFile( cacheFile ).setSuppressionsFileExpression( suppressionsFileExpression )
.setEncoding( getInputEncoding() ).setPropertiesLocation( propertiesLocation );
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
index d2bb6d0c..b3e8cc40 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleViolationCheckMojo.java
@@ -494,6 +494,7 @@ public void execute()
if ( !skipExec )
{
+ String effectiveConfigLocation = configLocation;
if ( checkstyleRules != null )
{
if ( !DEFAULT_CONFIG_LOCATION.equals( configLocation ) )
@@ -517,7 +518,7 @@ public void execute()
{
throw new MojoExecutionException( e.getMessage(), e );
}
- configLocation = rulesFiles.getAbsolutePath();
+ effectiveConfigLocation = rulesFiles.getAbsolutePath();
}
ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
@@ -535,7 +536,7 @@ public void execute()
.setProject( project ).setSourceDirectories( getSourceDirectories() )
.setResources( resources ).setTestResources( testResources )
.setStringOutputStream( stringOutputStream ).setSuppressionsLocation( suppressionsLocation )
- .setTestSourceDirectories( getTestSourceDirectories() ).setConfigLocation( configLocation )
+ .setTestSourceDirectories( getTestSourceDirectories() ).setConfigLocation( effectiveConfigLocation )
.setConfigurationArtifacts( collectArtifacts( "config" ) )
.setPropertyExpansion( propertyExpansion )
.setHeaderLocation( headerLocation ).setLicenseArtifacts( collectArtifacts( "license" ) )