You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ad...@apache.org on 2018/01/10 17:54:54 UTC

[maven-pmd-plugin] branch master updated (a7d7d69 -> 1b2dbbc)

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

adangel pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git.


    from a7d7d69  [MPMD-243] excludeFromFailureFile configuration does not work
     new 5fe9497  [MPMD-249] The plugin documentation point to old (deprecated) rulesets
     new 54edc6d  [MPMD-249] The plugin documentation point to old (deprecated) rulesets
     new a73773a  Fix maven pmd ruleset: the rule EmptyStaticInitializer doesn't exist anymore (has been merged into EmptyInitializer)
     new 1b2dbbc  Fix PMD, remove unnecessary suppress warnings

The 4 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:
 .../apache/maven/plugins/pmd/AbstractPmdReport.java    | 18 ++++++------------
 .../java/org/apache/maven/plugins/pmd/CpdReport.java   |  5 +++--
 .../java/org/apache/maven/plugins/pmd/PmdReport.java   |  2 +-
 src/main/resources/rulesets/maven.xml                  |  1 -
 src/site/apt/examples/usingRuleSets.apt.vm             | 10 ++++------
 5 files changed, 14 insertions(+), 22 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@maven.apache.org" <co...@maven.apache.org>'].

[maven-pmd-plugin] 02/04: [MPMD-249] The plugin documentation point to old (deprecated) rulesets

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

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 54edc6da05bf84997b761e5ca047335011d5ac2c
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Wed Jan 10 18:47:19 2018 +0100

    [MPMD-249] The plugin documentation point to old (deprecated) rulesets
    
    Update more documentation
---
 src/main/java/org/apache/maven/plugins/pmd/CpdReport.java |  5 +++--
 src/site/apt/examples/usingRuleSets.apt.vm                | 10 ++++------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
index e943b24..f139e06 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/CpdReport.java
@@ -55,8 +55,9 @@ import net.sourceforge.pmd.cpd.Renderer;
 import net.sourceforge.pmd.cpd.XMLRenderer;
 
 /**
- * Creates a report for PMD's CPD tool. See <a
- * href="http://pmd.sourceforge.net/cpd.html">http://pmd.sourceforge.net/cpd.html</a> for more detail.
+ * Creates a report for PMD's CPD tool. See
+ * <a href="https://pmd.github.io/latest/pmd_userdocs_cpd.html">Finding duplicated code</a>
+ * for more details.
  *
  * @author Mike Perham
  * @version $Id$
diff --git a/src/site/apt/examples/usingRuleSets.apt.vm b/src/site/apt/examples/usingRuleSets.apt.vm
index e38d3e5..7ac4e5f 100644
--- a/src/site/apt/examples/usingRuleSets.apt.vm
+++ b/src/site/apt/examples/usingRuleSets.apt.vm
@@ -3,7 +3,7 @@
  ------
  Maria Odea Ching
  ------
- 2017-11-11
+ 2018-01-10
  ------
 
  ~~ Licensed to the Apache Software Foundation (ASF) under one
@@ -68,9 +68,8 @@ Using Rule Sets
         <version>${project.version}</version>
         <configuration>
           <rulesets>
-            <!-- Two rule sets that come bundled with PMD -->
-            <ruleset>/rulesets/java/braces.xml</ruleset>
-            <ruleset>/rulesets/java/naming.xml</ruleset>
+            <!-- A rule set, that comes bundled with PMD -->
+            <ruleset>/category/java/bestpractices.xml</ruleset>
             <!-- Custom local file system rule set -->
             <ruleset>d:\rulesets\strings.xml</ruleset>
             <!-- Custom remote rule set accessed via a URL -->
@@ -92,7 +91,7 @@ The default ruleset
   If you use a different language, you'll need to specify your own custom ruleset.
 
   The current version of the ruleset can be found in version control:
-  {{http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-pmd-plugin/src/main/resources/rulesets/java/maven-pmd-plugin-default.xml}}
+  {{https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/main/resources/rulesets/java/maven-pmd-plugin-default.xml;hb=HEAD}}
 
 +-----+
     <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
@@ -132,7 +131,6 @@ The default ruleset
     <rule ref="category/java/errorprone.xml/EmptyInitializer" />
     <rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
     <rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
-    <rule ref="category/java/errorprone.xml/EmptyStaticInitializer" />
     <rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
     <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
     <rule ref="category/java/errorprone.xml/EmptyTryBlock" />

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-pmd-plugin] 01/04: [MPMD-249] The plugin documentation point to old (deprecated) rulesets

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

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 5fe94972bc3ede9310aac8ff52970f7074e0f66b
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Wed Jan 10 18:13:33 2018 +0100

    [MPMD-249] The plugin documentation point to old (deprecated) rulesets
    
    Use https for the link
---
 src/main/java/org/apache/maven/plugins/pmd/PmdReport.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
index 20b2e5e..e5a193d 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReport.java
@@ -119,7 +119,7 @@ public class PmdReport
 
     /**
      * The PMD rulesets to use. See the
-     * <a href="http://pmd.github.io/latest/pmd_rules_java.html">Stock Java Rulesets</a> for a
+     * <a href="https://pmd.github.io/latest/pmd_rules_java.html">Stock Java Rulesets</a> for a
      * list of available rules.
      * Defaults to a custom ruleset provided by this maven plugin
      * (<code>/rulesets/java/maven-pmd-plugin-default.xml</code>).

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-pmd-plugin] 04/04: Fix PMD, remove unnecessary suppress warnings

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

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit 1b2dbbc4b3d77725c79428f5c2cf9bb6f4be965c
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Wed Jan 10 18:50:37 2018 +0100

    Fix PMD, remove unnecessary suppress warnings
---
 .../apache/maven/plugins/pmd/AbstractPmdReport.java    | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
index ec2b056..af11911 100644
--- a/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
+++ b/src/main/java/org/apache/maven/plugins/pmd/AbstractPmdReport.java
@@ -274,7 +274,6 @@ public abstract class AbstractPmdReport
             else
             {
                 // Not yet generated - check if the report is on its way
-                @SuppressWarnings( "unchecked" )
                 List<ReportPlugin> reportPlugins = project.getReportPlugins();
                 for ( ReportPlugin plugin : reportPlugins )
                 {
@@ -347,18 +346,15 @@ public abstract class AbstractPmdReport
         {
             testSourceRoots = project.getTestCompileSourceRoots();
         }
-        if ( includeTests )
+        if ( includeTests && testSourceRoots != null )
         {
-            if ( testSourceRoots != null )
+            for ( String root : testSourceRoots )
             {
-                for ( String root : testSourceRoots )
+                File sroot = new File( root );
+                if ( sroot.exists() )
                 {
-                    File sroot = new File( root );
-                    if ( sroot.exists() )
-                    {
-                        String testXref = constructXRefLocation( true );
-                        directories.add( new PmdFileInfo( project, sroot, testXref ) );
-                    }
+                    String testXref = constructXRefLocation( true );
+                    directories.add( new PmdFileInfo( project, sroot, testXref ) );
                 }
             }
         }
@@ -366,7 +362,6 @@ public abstract class AbstractPmdReport
         {
             for ( MavenProject localProject : reactorProjects )
             {
-                @SuppressWarnings( "unchecked" )
                 List<String> localCompileSourceRoots = localProject.getCompileSourceRoots();
                 for ( String root : localCompileSourceRoots )
                 {
@@ -379,7 +374,6 @@ public abstract class AbstractPmdReport
                 }
                 if ( includeTests )
                 {
-                    @SuppressWarnings( "unchecked" )
                     List<String> localTestCompileSourceRoots = localProject.getTestCompileSourceRoots();
                     for ( String root : localTestCompileSourceRoots )
                     {

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.

[maven-pmd-plugin] 03/04: Fix maven pmd ruleset: the rule EmptyStaticInitializer doesn't exist anymore (has been merged into EmptyInitializer)

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

adangel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-pmd-plugin.git

commit a73773a825bb9869b361a318770b00ab16d46716
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Wed Jan 10 18:47:46 2018 +0100

    Fix maven pmd ruleset: the rule EmptyStaticInitializer doesn't
    exist anymore (has been merged into EmptyInitializer)
---
 src/main/resources/rulesets/maven.xml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/main/resources/rulesets/maven.xml b/src/main/resources/rulesets/maven.xml
index c7918f6..706d8ee 100644
--- a/src/main/resources/rulesets/maven.xml
+++ b/src/main/resources/rulesets/maven.xml
@@ -74,7 +74,6 @@ under the License.
     <rule ref="category/java/errorprone.xml/EmptyInitializer" />
     <rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
     <rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
-    <rule ref="category/java/errorprone.xml/EmptyStaticInitializer" />
     <rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
     <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
     <rule ref="category/java/errorprone.xml/EmptyTryBlock" />

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.