From be7204e14599a311ae065c233efb2bcc22c6cf56 Mon Sep 17 00:00:00 2001
From: epugh
Date: Tue, 22 Jul 2003 16:13:27 +0000
Subject: [PATCH] Give PMD include/exclude filters. Same idea as in
Checkstyle.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113685 13f79535-47bb-0310-9956-ffa450edef68
---
pmd/plugin.jelly | 6 ++++--
pmd/plugin.properties | 3 +++
pmd/xdocs/changes.xml | 3 +++
pmd/xdocs/how-to.xml | 12 ++++++++++--
pmd/xdocs/properties.xml | 24 ++++++++++++++++++++++++
5 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/pmd/plugin.jelly b/pmd/plugin.jelly
index 2a9e0626..710c7d9d 100644
--- a/pmd/plugin.jelly
+++ b/pmd/plugin.jelly
@@ -82,7 +82,9 @@
-
+
+
+
@@ -99,7 +101,7 @@
-
+
Converting the PMD report to xdoc ...
diff --git a/pmd/plugin.properties b/pmd/plugin.properties
index d1b68081..ac5264cd 100644
--- a/pmd/plugin.properties
+++ b/pmd/plugin.properties
@@ -12,3 +12,6 @@ maven.pmd.enable = true
# rulesets/experimental.xml is, well, experimental ... use at your own risk
maven.pmd.rulesetfiles=${plugin.resources}/rulesets/basic.xml,${plugin.resources}/rulesets/unusedcode.xml,${plugin.resources}/rulesets/imports.xml
+
+maven.pmd.includes = **/*.java
+maven.pmd.excludes =
diff --git a/pmd/xdocs/changes.xml b/pmd/xdocs/changes.xml
index f6b9874c..d8d03474 100644
--- a/pmd/xdocs/changes.xml
+++ b/pmd/xdocs/changes.xml
@@ -9,6 +9,9 @@
+
+ Adding maven.pmd.includes and maven.pmd.excludes to match functionality in checkstyle plugin.
+
Now respects pom.build.sourceModifications
diff --git a/pmd/xdocs/how-to.xml b/pmd/xdocs/how-to.xml
index 2a80c39c..a8ade06a 100644
--- a/pmd/xdocs/how-to.xml
+++ b/pmd/xdocs/how-to.xml
@@ -21,12 +21,20 @@
-
+
Assume that you have generated a DB layer having a few
hundreds Java source files. Apart from being curious you
don't want to have a PMD report for generated source files.
- Simple put "maven.pmd.enable=false" into your project properties
+ Simply put "maven.pmd.enable=false" into your project properties.
+
+
+
+
+
+ Also assuming that you have generated a DB layer within your project.
+ Simply put "maven.pmd.excludes=**/database/**" into your project
+ properties.
diff --git a/pmd/xdocs/properties.xml b/pmd/xdocs/properties.xml
index 9b02180a..61861ba6 100644
--- a/pmd/xdocs/properties.xml
+++ b/pmd/xdocs/properties.xml
@@ -30,6 +30,30 @@
already defined in the plugin
+
+ | maven.pmd.includes |
+ Yes |
+
+ Specifies a comma-separated list of Ant patterns to use
+ when matching files in the source tree to be included in the
+ PMD report. The pattern specified is relative to
+ ${maven.src.dir}. The default value is
+ **/*.java, which matches all Java source files
+ in the source tree (specified by the ${maven.src.dir}
+ property.
+ |
+
+
+ | maven.pmd.excludes |
+ Yes |
+
+ Specifies a comma-separated list of Ant patterns to use when
+ matching files in the source tree to be excluded from the
+ PMD report. The pattern specified is relative to
+ ${maven.src.dir}. The default value is to not
+ exclude any files.
+ |
+