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
This commit is contained in:
parent
1bb179001d
commit
be7204e145
@ -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>
|
||||
|
||||
|
||||
@ -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 =
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user