You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by eo...@apache.org on 2019/05/01 08:24:09 UTC

[maven-checkstyle-plugin] branch MCHECKSTYLE-289 updated (3df8ff3 -> e4aec5b)

This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a change to branch MCHECKSTYLE-289
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git.


 discard 3df8ff3  [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration
     add e924823  [MNGSITE-332] - Changed download templates of plugins not to reference .md5 anymore
     add 9db6ed7  [MCHECKSTYLE-352] - Add documentation information for GitHub
     add ab6a941  [INFRA-16467] move components documentation out of CMS space
     add 94e059f  Fixed link to mailing list.
     add 5bbf2a4  [MCHECKSTYLE-359] - Upgrade maven-plugins parent to version 32
     add e288f40  [MCHECKSTYLE-360] - Upgrade maven-site-plugin to 3.7.1 for integration tests
     add f6abc63  Switch to asfMavenTlpPlgnBuild
     add 306d645  [MNGSITE-341] use https for sigs, hashes and KEYS
     add 9213f4b  [MPOM-205] use sha512 checksums instead of sha1
     add c4505ee  upgraded parent POM from 32 to 33
     add 0de3460  [MCHECKSTYLE-357] - Allow inline configuration for reporting
     add 84acd48  [MCHECKSTYLE-357] - Expand inline documentation
     add f6b9efc  Add Travis configuration file
     add eee0ba1  [MCHECKSTYLE-365] Correct counts in Rules section
     add bec97ad  Bump version tp 3.1.0-SNAPSHOT
     add 6704658  [MCHECKSTYLE-366] Upgrade checkstyle to a more recent version and require Java 8 as Checkstyle 7+ requires Java 8
     add 29ebada  [MCHECKSTYLE-374] - replace deprecated method calls with newer checkstyle version
     add 0edb5d5  [MCHECKSTYLE-54] Add integration test
     add f39761f  [MCHECKSTYLE-163] Add integration test
     new e4aec5b  [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (3df8ff3)
            \
             N -- N -- N   refs/heads/MCHECKSTYLE-289 (e4aec5b)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/pull_request_template.md                   |  29 +++
 .../invoker.properties => .travis.yml              |  20 +-
 CONTRIBUTING.md                                    |  91 +++++++++
 Jenkinsfile                                        |   2 +-
 README.md                                          |  97 ++++++++++
 pom.xml                                            |  15 +-
 src/it/MCHECKSTYLE-129/pom.xml                     |   2 +-
 src/it/MCHECKSTYLE-137/checkstyle.xml              |   9 +-
 .../MCHECKSTYLE-137/src/main/java/org/MyClass.java |  17 +-
 .../checkstyle.xml                                 |  14 +-
 .../invoker.properties                             |   1 -
 .../{MCHECKSTYLE-131 => MCHECKSTYLE-163}/pom.xml   |  30 +--
 .../checkstyle/mcheckstyle163/Mcheckstyle163.java} |  30 ++-
 .../com/company/build-tools/checkstyle.xml         |   1 -
 src/it/MCHECKSTYLE-193/checkstyle.xml              |   3 -
 src/it/MCHECKSTYLE-332_cache-checker/pom.xml       |  10 +-
 .../invoker.properties                             |  18 --
 src/it/MCHECKSTYLE-332_cache-treewalker/pom.xml    |  63 -------
 .../src/main/java/org/MyClass.java                 |  26 ---
 .../MCHECKSTYLE-332_cache-treewalker/verify.groovy |  23 ---
 .../plugins/checkstyle/EmptyLoggingCheck.java      |   9 +-
 .../invoker.properties                             |   5 +-
 .../MCHECKSTYLE-357-with-header-override/pom.xml   | 201 ++++++++++++++++++++
 .../src/main/java/cat}/App.java                    |   9 +-
 .../verify.groovy                                  |  15 +-
 .../invoker.properties                             |   3 +-
 src/it/MCHECKSTYLE-357/pom.xml                     | 187 +++++++++++++++++++
 .../src/main/java/cat}/App.java                    |   9 +-
 .../verify.groovy                                  |  15 +-
 .../invoker.properties                             |   3 +-
 src/it/MCHECKSTYLE-365/pom.xml                     | 111 +++++++++++
 .../src/main/java/cat}/App.java                    |  11 +-
 .../src/main/resources/test.properties             |   3 +-
 src/it/MCHECKSTYLE-365/verify.groovy               |  45 +++++
 .../invoker.properties                             |   1 -
 src/it/{MCHECKSTYLE-131 => MCHECKSTYLE-54}/pom.xml |  35 ++--
 .../checkstyle/mcheckstyle54/Mcheckstyle54.java}   |  25 ++-
 .../checkstyle/mcheckstyle54/package-info.java}    |   7 +-
 .../maven/plugins/checkstyle/its/AppTest.java      |   4 +-
 src/it/multi-modules-aggregate/maven_checks.xml    | 205 +++++++++++++++++++++
 src/it/multi-modules-aggregate/pom.xml             |  12 +-
 src/it/multi-modules-aggregate/verify.groovy       |   3 +-
 .../checkstyle/AbstractCheckstyleReport.java       |  80 +++++++-
 .../checkstyle/CheckstyleReportGenerator.java      |  19 +-
 .../checkstyle/CheckstyleViolationCheckMojo.java   |  31 ++--
 .../checkstyle/exec/CheckstyleCheckerListener.java |  16 +-
 .../checkstyle/exec/DefaultCheckstyleExecutor.java |  51 ++---
 src/site/apt/examples/inline-checker-config.apt.vm |  74 ++++++++
 src/site/apt/examples/multi-module-config.apt.vm   |   4 +
 src/site/xdoc/download.xml.vm                      |   6 +-
 50 files changed, 1329 insertions(+), 371 deletions(-)
 create mode 100644 .github/pull_request_template.md
 copy src/it/MCHECKSTYLE-219-no-license_failure/invoker.properties => .travis.yml (76%)
 create mode 100644 CONTRIBUTING.md
 create mode 100644 README.md
 copy src/it/{MCHECKSTYLE-131 => MCHECKSTYLE-163}/checkstyle.xml (72%)
 copy src/it/{MCHECKSTYLE-347 => MCHECKSTYLE-163}/invoker.properties (96%)
 copy src/it/{MCHECKSTYLE-131 => MCHECKSTYLE-163}/pom.xml (67%)
 copy src/it/{multi-modules/multi-modules-child/src/main/java/org/apache/maven/plugins/checkstyle/its/App.java => MCHECKSTYLE-163/src/test/java/org/apache/maven/plugins/checkstyle/mcheckstyle163/Mcheckstyle163.java} (61%)
 delete mode 100644 src/it/MCHECKSTYLE-332_cache-treewalker/invoker.properties
 delete mode 100644 src/it/MCHECKSTYLE-332_cache-treewalker/pom.xml
 delete mode 100644 src/it/MCHECKSTYLE-332_cache-treewalker/src/main/java/org/MyClass.java
 delete mode 100644 src/it/MCHECKSTYLE-332_cache-treewalker/verify.groovy
 copy src/it/{MCHECKSTYLE-295 => MCHECKSTYLE-357-with-header-override}/invoker.properties (90%)
 create mode 100644 src/it/MCHECKSTYLE-357-with-header-override/pom.xml
 copy src/it/{MCHECKSTYLE-129/src/main/java/com/example => MCHECKSTYLE-357-with-header-override/src/main/java/cat}/App.java (75%)
 copy src/it/{checkstyle-report => MCHECKSTYLE-357-with-header-override}/verify.groovy (78%)
 copy src/it/{MCHECKSTYLE-295 => MCHECKSTYLE-357}/invoker.properties (94%)
 create mode 100644 src/it/MCHECKSTYLE-357/pom.xml
 copy src/it/{MCHECKSTYLE-129/src/main/java/com/example => MCHECKSTYLE-357/src/main/java/cat}/App.java (75%)
 copy src/it/{checkstyle-report => MCHECKSTYLE-357}/verify.groovy (78%)
 copy src/it/{MCHECKSTYLE-295 => MCHECKSTYLE-365}/invoker.properties (94%)
 create mode 100644 src/it/MCHECKSTYLE-365/pom.xml
 copy src/it/{MCHECKSTYLE-129/src/main/java/com/example => MCHECKSTYLE-365/src/main/java/cat}/App.java (73%)
 copy src/it/{MCHECKSTYLE-193 => MCHECKSTYLE-365}/src/main/resources/test.properties (88%)
 create mode 100644 src/it/MCHECKSTYLE-365/verify.groovy
 copy src/it/{MCHECKSTYLE-347 => MCHECKSTYLE-54}/invoker.properties (96%)
 copy src/it/{MCHECKSTYLE-131 => MCHECKSTYLE-54}/pom.xml (67%)
 copy src/it/{multi-modules/multi-modules-child/src/main/java/org/apache/maven/plugins/checkstyle/its/App.java => MCHECKSTYLE-54/src/main/java/org/apache/maven/plugins/checkstyle/mcheckstyle54/Mcheckstyle54.java} (67%)
 copy src/it/{MCHECKSTYLE-172/src/main/java/org/MyClass.java => MCHECKSTYLE-54/src/main/java/org/apache/maven/plugins/checkstyle/mcheckstyle54/package-info.java} (91%)
 create mode 100644 src/it/multi-modules-aggregate/maven_checks.xml


[maven-checkstyle-plugin] 01/01: [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with default configuration

Posted by eo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eolivelli pushed a commit to branch MCHECKSTYLE-289
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git

commit e4aec5b2b19f15d5f437bb9a45bc773e543ccf44
Author: Guillaume Boué <gb...@apache.org>
AuthorDate: Sat Apr 7 23:56:18 2018 +0200

    [MCHECKSTYLE-289] enableRulesSummary option does not show Rules with
    default configuration
    
    Add parameter to explicitly show rules without any violations in the
    Rules summary.
---
 src/it/MCHECKSTYLE-289/checkstyle.xml              | 27 +++++++++
 src/it/MCHECKSTYLE-289/pom.xml                     | 53 ++++++++++++++++++
 .../MCHECKSTYLE-289/src/main/java/org/MyClass.java | 26 +++++++++
 src/it/MCHECKSTYLE-289/verify.groovy               | 22 ++++++++
 .../checkstyle/AbstractCheckstyleReport.java       |  9 +++
 .../checkstyle/CheckstyleReportGenerator.java      | 24 ++++++--
 .../checkstyle/exec/CheckstyleModuleFactory.java   | 64 ++++++++++++++++++++++
 .../plugins/checkstyle/exec/CheckstyleResults.java | 11 ++++
 .../checkstyle/exec/DefaultCheckstyleExecutor.java |  9 ++-
 9 files changed, 237 insertions(+), 8 deletions(-)

diff --git a/src/it/MCHECKSTYLE-289/checkstyle.xml b/src/it/MCHECKSTYLE-289/checkstyle.xml
new file mode 100644
index 0000000..564a7ab
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/checkstyle.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+  <module name="TreeWalker">
+    <module name="OuterTypeFilename"/>
+  </module>
+  <!-- add module that is not a check to verify that it does not interfere -->
+  <module name="SuppressionCommentFilter"/>
+</module>
diff --git a/src/it/MCHECKSTYLE-289/pom.xml b/src/it/MCHECKSTYLE-289/pom.xml
new file mode 100644
index 0000000..1ad0dcb
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/pom.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins.checkstyle</groupId>
+  <artifactId>mcheckstytle-289</artifactId>
+  <version>1.0</version>
+  <url>https://issues.apache.org/jira/browse/MCHECKSTYLE-289</url>
+  <description>Tests that setting skipEmptyViolationRules to false correctly shows rules with no violations</description>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>@pom.version@</version>
+        <configuration>
+          <configLocation>checkstyle.xml</configLocation>
+          <skipEmptyViolationRules>false</skipEmptyViolationRules>
+        </configuration>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>checkstyle</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>
diff --git a/src/it/MCHECKSTYLE-289/src/main/java/org/MyClass.java b/src/it/MCHECKSTYLE-289/src/main/java/org/MyClass.java
new file mode 100644
index 0000000..967d603
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/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.
+ */
+
+/**
+ * My Class.
+ */
+public class MyClass {
+}
diff --git a/src/it/MCHECKSTYLE-289/verify.groovy b/src/it/MCHECKSTYLE-289/verify.groovy
new file mode 100644
index 0000000..c0f3700
--- /dev/null
+++ b/src/it/MCHECKSTYLE-289/verify.groovy
@@ -0,0 +1,22 @@
+
+/*
+ * 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.
+ */
+
+def html = new File( basedir, 'target/site/checkstyle.html' ).text;
+assert html =~ /(?s)<td>misc<\/td>.*?<td>.*?OuterTypeFilename.*?<\/td>.*?<td>0<\/td>/
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 04ccba1..40cfdfa 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleReport.java
@@ -360,6 +360,14 @@ public abstract class AbstractCheckstyleReport
     private boolean enableRSS;
 
     /**
+     * Specifies if rules with no violations should be skipped from the Rules summary.
+     *
+     * @since 3.0.1
+     */
+    @Parameter( property = "checkstyle.skipEmptyViolationRules", defaultValue = "true" )
+    private boolean skipEmptyViolationRules;
+
+    /**
      * SiteTool.
      *
      * @since 2.2
@@ -740,6 +748,7 @@ public abstract class AbstractCheckstyleReport
         generator.setEnableSeveritySummary( enableSeveritySummary );
         generator.setEnableFilesSummary( enableFilesSummary );
         generator.setEnableRSS( enableRSS );
+        generator.setSkipEmptyViolationRules( skipEmptyViolationRules );
         generator.setCheckstyleConfig( results.getConfiguration() );
         if ( linkXRef )
         {
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
index 9e4892f..0f63dc1 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/CheckstyleReportGenerator.java
@@ -65,6 +65,8 @@ public class CheckstyleReportGenerator
 
     private boolean enableFilesSummary;
 
+    private boolean skipEmptyViolationRules;
+
     private boolean enableRSS;
 
     private final SiteTool siteTool;
@@ -740,6 +742,16 @@ public class CheckstyleReportGenerator
         this.enableRSS = enableRSS;
     }
 
+    public boolean isSkipEmptyViolationRules()
+    {
+        return skipEmptyViolationRules;
+    }
+
+    public void setSkipEmptyViolationRules( boolean showEmptyViolationRules )
+    {
+        this.skipEmptyViolationRules = showEmptyViolationRules;
+    }
+
     public String getXrefLocation()
     {
         return xrefLocation;
@@ -813,24 +825,24 @@ public class CheckstyleReportGenerator
 
                 // count rule violations
                 long violations = 0;
-                AuditEvent lastMatchedEvent = null;
                 for ( List<AuditEvent> errors : results.getFiles().values() )
                 {
                     for ( AuditEvent event : errors )
                     {
                         if ( matchRule( event, ruleName, fixedmessage, configSeverity ) )
                         {
-                            lastMatchedEvent = event;
                             violations++;
                         }
                     }
                 }
 
-                if ( violations > 0 ) // forget rules without violations
+                if ( violations > 0 || !skipEmptyViolationRules ) // forget rules without violations when not requested
                 {
-                    String category = RuleUtil.getCategory( lastMatchedEvent );
-
-                    result.add( new ConfReference( category, childConfig, parent, violations, result.size() ) );
+                    String category = RuleUtil.getCategory( results.getModuleNameMap().get( ruleName ) );
+                    if ( category != null )
+                    {
+                        result.add( new ConfReference( category, childConfig, parent, violations, result.size() ) );
+                    }
                 }
             }
         }
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java
new file mode 100644
index 0000000..a5ba0fd
--- /dev/null
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleModuleFactory.java
@@ -0,0 +1,64 @@
+package org.apache.maven.plugins.checkstyle.exec;
+
+/*
+ * 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.
+ */
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.puppycrawl.tools.checkstyle.PackageObjectFactory;
+import com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter;
+import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
+
+/**
+ * Extension of the package object factory, which remembers the check class name from a given name.
+ *
+ * @author gboue
+ */
+public class CheckstyleModuleFactory
+    extends PackageObjectFactory
+{
+
+    private Map<String, String> moduleNameMap = new ConcurrentHashMap<>();
+
+    public CheckstyleModuleFactory( Set<String> packageNames, ClassLoader moduleClassLoader )
+    {
+        super( packageNames, moduleClassLoader );
+    }
+
+    @Override
+    public Object createModule( String name )
+        throws CheckstyleException
+    {
+        Object module = super.createModule( name );
+        if ( module instanceof AbstractViolationReporter )
+        {
+            moduleNameMap.put( name, module.getClass().getName() );
+        }
+        return module;
+    }
+
+    public Map<String, String> getModuleNameMap()
+    {
+        return Collections.unmodifiableMap( moduleNameMap );
+    }
+
+}
diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
index ce2a4a6..1b96189 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/CheckstyleResults.java
@@ -38,6 +38,7 @@ import java.util.Map;
 public class CheckstyleResults
 {
     private Map<String, List<AuditEvent>> files;
+    private Map<String, String> moduleNameMap;
 
     private Configuration configuration;
 
@@ -141,4 +142,14 @@ public class CheckstyleResults
     {
         this.configuration = configuration;
     }
+
+    public Map<String, String> getModuleNameMap()
+    {
+        return moduleNameMap;
+    }
+
+    public void setModuleNameMap( Map<String, String> moduleNameMap )
+    {
+        this.moduleNameMap = moduleNameMap;
+    }
 }
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 9a35945..26fd9d3 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
@@ -203,7 +203,10 @@ public class DefaultCheckstyleExecutor
 
         checker.setClassLoader( projectClassLoader );
 
-        checker.setModuleClassLoader( Thread.currentThread().getContextClassLoader() );
+        ClassLoader moduleClassLoader = Thread.currentThread().getContextClassLoader();
+        CheckstyleModuleFactory moduleFactory =
+            new CheckstyleModuleFactory( PackageNamesLoader.getPackageNames( moduleClassLoader ), moduleClassLoader );
+        checker.setModuleFactory( moduleFactory );
 
         if ( filterSet != null )
         {
@@ -313,7 +316,9 @@ public class DefaultCheckstyleExecutor
             }
         }
 
-        return checkerListener.getResults();
+        CheckstyleResults results = checkerListener.getResults();
+        results.setModuleNameMap( moduleFactory.getModuleNameMap() );
+        return results;
     }
 
     protected void addSourceDirectory( CheckstyleCheckerListener sinkListener, Collection<File> sourceDirectories,