epugh 2003/07/22 09:13:27
Modified: src/plugins-build/pmd/xdocs changes.xml properties.xml
how-to.xml
src/plugins-build/pmd plugin.jelly plugin.properties
Log:
Give PMD include/exclude filters. Same idea as in Checkstyle.
Revision Changes Path
1.8 +3 -0 maven/src/plugins-build/pmd/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/pmd/xdocs/changes.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- changes.xml 22 Jul 2003 07:13:29 -0000 1.7
+++ changes.xml 22 Jul 2003 16:13:26 -0000 1.8
@@ -9,6 +9,9 @@
<body>
<release version="1.1" date="in CVS">
+ <action dev="epugh" type="add">
+ Adding maven.pmd.includes and maven.pmd.excludes to match functionality in
checkstyle plugin.
+ </action>
<action dev="dion" type="fix">
Now respects pom.build.sourceModifications
</action>
1.2 +24 -0 maven/src/plugins-build/pmd/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/pmd/xdocs/properties.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- properties.xml 3 Apr 2003 18:58:12 -0000 1.1
+++ properties.xml 22 Jul 2003 16:13:26 -0000 1.2
@@ -30,6 +30,30 @@
already defined in the plugin
</td>
</tr>
+ <tr>
+ <td>maven.pmd.includes</td>
+ <td>Yes</td>
+ <td>
+ 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
+ <code>${maven.src.dir}</code>. The default value is
+ <code>**/*.java</code>, which matches all Java source files
+ in the source tree (specified by the <code>${maven.src.dir}</code>
+ property.
+ </td>
+ </tr>
+ <tr>
+ <td>maven.pmd.excludes</td>
+ <td>Yes</td>
+ <td>
+ 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
+ <code>${maven.src.dir}</code>. The default value is to not
+ exclude any files.
+ </td>
+ </tr>
</table>
</section>
</body>
1.2 +10 -2 maven/src/plugins-build/pmd/xdocs/how-to.xml
Index: how-to.xml
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/pmd/xdocs/how-to.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- how-to.xml 3 Apr 2003 18:58:12 -0000 1.1
+++ how-to.xml 22 Jul 2003 16:13:27 -0000 1.2
@@ -21,12 +21,20 @@
</p>
</subsection>
- <subsection name="How to disable PMD for one projects?">
+ <subsection name="How to disable PMD for one project?">
<p>
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.
+ </p>
+ </subsection>
+
+ <subsection name="How to disable PMD for certain files?">
+ <p>
+ Also assuming that you have generated a DB layer within your project.
+ Simply put "maven.pmd.excludes=**/database/**" into your project
+ properties.
</p>
</subsection>
1.8 +4 -2 maven/src/plugins-build/pmd/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/pmd/plugin.jelly,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- plugin.jelly 22 Jul 2003 15:57:56 -0000 1.7
+++ plugin.jelly 22 Jul 2003 16:13:27 -0000 1.8
@@ -82,7 +82,9 @@
<pmd rulesetfiles="${maven.pmd.rulesetfiles}">
<formatter type="xml" toFile="${maven.build.dir}/pmd-raw-report.xml"/>
<fileset dir="${pom.build.sourceDirectory}">
- <include name="**/*.java"/>
+ <include name="${maven.pmd.includes}"/>
+ <exclude name="${maven.pmd.excludes}"/>
+
<!-- FIXME: This is a bad cut and paste -->
<!-- handle source modifications -->
<j:forEach var="sm" items="${pom.build.sourceModifications}">
@@ -99,7 +101,7 @@
</fileset>
</pmd>
- <!-- Run DVSL to transform the report into XDOC -->
+ <!-- Run JSL to transform the report into XDOC -->
<echo>Converting the PMD report to xdoc ...</echo>
1.4 +3 -0 maven/src/plugins-build/pmd/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/maven/src/plugins-build/pmd/plugin.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- plugin.properties 16 Jun 2003 20:57:23 -0000 1.3
+++ plugin.properties 22 Jul 2003 16:13:27 -0000 1.4
@@ -12,3 +12,6 @@
# 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 =
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]