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 2021/04/24 16:27:07 UTC

[maven-pmd-plugin] branch master updated (2d4205a -> 23f28d1)

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 2d4205a  [MPMD-312] Upgrade to PMD 6.33.0
     new e9c83ed  [MPMD-312] Upgrade to PMD 6.34.0
     new 23f28d1  [MPMD-312] Replace rules that are deprecated with PMD 6.34.0

The 2 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:
 pom.xml                                                       | 2 +-
 src/main/resources/rulesets/java/maven-pmd-plugin-default.xml | 5 +----
 src/main/resources/rulesets/maven.xml                         | 5 +----
 src/site/apt/examples/multi-module-config.apt.vm              | 4 +---
 src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm         | 2 +-
 src/site/apt/examples/usingRuleSets.apt.vm                    | 5 +----
 src/test/resources/unit/excludes/pmd_exclude.properties       | 2 +-
 7 files changed, 7 insertions(+), 18 deletions(-)

[maven-pmd-plugin] 01/02: [MPMD-312] Upgrade to PMD 6.34.0

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 e9c83ed51ae4d569e9ac72275fc927748239bc07
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Sat Apr 24 18:04:14 2021 +0200

    [MPMD-312] Upgrade to PMD 6.34.0
---
 pom.xml                                               | 2 +-
 src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7fae8f8..b5b1805 100644
--- a/pom.xml
+++ b/pom.xml
@@ -89,7 +89,7 @@ under the License.
     <doxiaVersion>1.9.1</doxiaVersion>
     <doxiaSitetoolsVersion>1.9.2</doxiaSitetoolsVersion>
     <javaVersion>7</javaVersion><!-- Because PMD 5.4+ requires Java 7 -->
-    <pmdVersion>6.33.0</pmdVersion>
+    <pmdVersion>6.34.0</pmdVersion>
     <slf4jVersion>1.7.25</slf4jVersion>
     <sitePluginVersion>3.7.1</sitePluginVersion>
     <projectInfoReportsPluginVersion>3.0.0</projectInfoReportsPluginVersion>
diff --git a/src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm b/src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm
index 8bcde5b..b238e01 100644
--- a/src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm
+++ b/src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm
@@ -88,7 +88,7 @@ Upgrading PMD at Runtime
 *--------------------------------------------------------------------------------*--------------------------------------------------*
 | <<maven-pmd-plugin>>                                                           | <<PMD>>                                          |
 *--------------------------------------------------------------------------------*--------------------------------------------------*
-| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.15.0/}3.15.0}} | {{{https://pmd.github.io/pmd-6.33.0/}6.33.0}}    |
+| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.15.0/}3.15.0}} | {{{https://pmd.github.io/pmd-6.34.0/}6.34.0}}    |
 *--------------------------------------------------------------------------------*--------------------------------------------------*
 | {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.14.0/}3.14.0}} | {{{https://pmd.github.io/pmd-6.29.0/}6.29.0}}    |
 *--------------------------------------------------------------------------------*--------------------------------------------------*

[maven-pmd-plugin] 02/02: [MPMD-312] Replace rules that are deprecated with PMD 6.34.0

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 23f28d1345b31d430020a1598350e86b23c3a957
Author: Andreas Dangel <ad...@apache.org>
AuthorDate: Sat Apr 24 18:22:22 2021 +0200

    [MPMD-312] Replace rules that are deprecated with PMD 6.34.0
    
    The rules UnusedImport, DontImportJavaLang, ImportFromSamePackage,
    and DuplicateImports are deprecated.
    The rule UnnecessaryImport is used instead.
---
 src/main/resources/rulesets/java/maven-pmd-plugin-default.xml | 5 +----
 src/main/resources/rulesets/maven.xml                         | 5 +----
 src/site/apt/examples/multi-module-config.apt.vm              | 4 +---
 src/site/apt/examples/usingRuleSets.apt.vm                    | 5 +----
 src/test/resources/unit/excludes/pmd_exclude.properties       | 2 +-
 5 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/main/resources/rulesets/java/maven-pmd-plugin-default.xml b/src/main/resources/rulesets/java/maven-pmd-plugin-default.xml
index 472cade..7604fdc 100644
--- a/src/main/resources/rulesets/java/maven-pmd-plugin-default.xml
+++ b/src/main/resources/rulesets/java/maven-pmd-plugin-default.xml
@@ -34,18 +34,16 @@ under the License.
 
     <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
     <rule ref="category/java/bestpractices.xml/CheckResultSet" />
-    <rule ref="category/java/bestpractices.xml/UnusedImports" />
     <rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
     <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
 
-    <rule ref="category/java/codestyle.xml/DontImportJavaLang" />
-    <rule ref="category/java/codestyle.xml/DuplicateImports" />
     <rule ref="category/java/codestyle.xml/ExtendsObject" />
     <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
     <rule ref="category/java/codestyle.xml/TooManyStaticImports" />
     <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
+    <rule ref="category/java/codestyle.xml/UnnecessaryImport" />
     <rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
     <rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
     <rule ref="category/java/codestyle.xml/UselessParentheses" />
@@ -73,7 +71,6 @@ under the License.
     <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
     <rule ref="category/java/errorprone.xml/EmptyTryBlock" />
     <rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
-    <rule ref="category/java/errorprone.xml/ImportFromSamePackage" />
     <rule ref="category/java/errorprone.xml/JumbledIncrementer" />
     <rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
     <rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
diff --git a/src/main/resources/rulesets/maven.xml b/src/main/resources/rulesets/maven.xml
index e37ca6a..4386fdf 100644
--- a/src/main/resources/rulesets/maven.xml
+++ b/src/main/resources/rulesets/maven.xml
@@ -39,14 +39,12 @@ under the License.
     <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
-    <rule ref="category/java/bestpractices.xml/UnusedImports" />
 
-    <rule ref="category/java/codestyle.xml/DontImportJavaLang" />
-    <rule ref="category/java/codestyle.xml/DuplicateImports" />
     <rule ref="category/java/codestyle.xml/ExtendsObject" />
     <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
     <rule ref="category/java/codestyle.xml/TooManyStaticImports" />
     <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
+    <rule ref="category/java/codestyle.xml/UnnecessaryImport" />
     <rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
     <rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
     <rule ref="category/java/codestyle.xml/UselessParentheses" />
@@ -78,7 +76,6 @@ under the License.
     <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
     <rule ref="category/java/errorprone.xml/EmptyTryBlock" />
     <rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
-    <rule ref="category/java/errorprone.xml/ImportFromSamePackage" />
     <rule ref="category/java/errorprone.xml/JumbledIncrementer" />
     <rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
     <rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
diff --git a/src/site/apt/examples/multi-module-config.apt.vm b/src/site/apt/examples/multi-module-config.apt.vm
index 1ab1a89..1af734a 100644
--- a/src/site/apt/examples/multi-module-config.apt.vm
+++ b/src/site/apt/examples/multi-module-config.apt.vm
@@ -102,14 +102,12 @@ whizbang
 
     <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
     <rule ref="category/java/bestpractices.xml/CheckResultSet" />
-    <rule ref="category/java/bestpractices.xml/UnusedImports" />
     <rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
     <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
 
-    <rule ref="category/java/codestyle.xml/DontImportJavaLang" />
-    <rule ref="category/java/codestyle.xml/DuplicateImports" />
+    <rule ref="category/java/codestyle.xml/UnnecessaryImport" />
 
     <rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
     <rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
diff --git a/src/site/apt/examples/usingRuleSets.apt.vm b/src/site/apt/examples/usingRuleSets.apt.vm
index 7aba4cb..51cc118 100644
--- a/src/site/apt/examples/usingRuleSets.apt.vm
+++ b/src/site/apt/examples/usingRuleSets.apt.vm
@@ -96,18 +96,16 @@ The default ruleset
 +-----+
     <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
     <rule ref="category/java/bestpractices.xml/CheckResultSet" />
-    <rule ref="category/java/bestpractices.xml/UnusedImports" />
     <rule ref="category/java/bestpractices.xml/UnusedFormalParameter" />
     <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
     <rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
 
-    <rule ref="category/java/codestyle.xml/DontImportJavaLang" />
-    <rule ref="category/java/codestyle.xml/DuplicateImports" />
     <rule ref="category/java/codestyle.xml/ExtendsObject" />
     <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
     <rule ref="category/java/codestyle.xml/TooManyStaticImports" />
     <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
+    <rule ref="category/java/codestyle.xml/UnnecessaryImport" />
     <rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
     <rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
     <rule ref="category/java/codestyle.xml/UselessParentheses" />
@@ -135,7 +133,6 @@ The default ruleset
     <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
     <rule ref="category/java/errorprone.xml/EmptyTryBlock" />
     <rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
-    <rule ref="category/java/errorprone.xml/ImportFromSamePackage" />
     <rule ref="category/java/errorprone.xml/JumbledIncrementer" />
     <rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
     <rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
diff --git a/src/test/resources/unit/excludes/pmd_exclude.properties b/src/test/resources/unit/excludes/pmd_exclude.properties
index 98712de..07b5d52 100644
--- a/src/test/resources/unit/excludes/pmd_exclude.properties
+++ b/src/test/resources/unit/excludes/pmd_exclude.properties
@@ -17,5 +17,5 @@
 # under the License.
 #
 def.configuration.App=UnusedPrivateField,EmptyCatchBlock,UselessParentheses
-def.configuration.App2=UnusedImports
+def.configuration.App2=UnnecessaryImport
 def.configuration.AppSample=UnusedPrivateField,UnusedFormalParameter,UnusedPrivateMethod,UselessParentheses