You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by di...@apache.org on 2004/07/29 16:31:30 UTC
cvs commit: maven-plugins/pmd plugin.jelly
dion 2004/07/29 07:31:30
Modified: pmd/xdocs changes.xml
pmd plugin.jelly
Log:
MPPMD-12. Only run PMD if sources present
Revision Changes Path
1.24 +3 -0 maven-plugins/pmd/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/pmd/xdocs/changes.xml,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- changes.xml 28 Jun 2004 11:31:23 -0000 1.23
+++ changes.xml 29 Jul 2004 14:31:30 -0000 1.24
@@ -25,6 +25,9 @@
<author email="vmassol@apache.org">Vincent Massol</author>
</properties>
<body>
+ <release version="1.6-SNAPSHOT" date="in CVS">
+ <action dev="dion" issue="MPPMD-12" type="fix">Check sources are present before calling PMD.</action>
+ </release>
<release version="1.5" date="2004-06-28">
<action dev="brett" due-to="Joakim Erdfelt" issue="MPPMD-2" type="update">Upgrade to PMD 1.3, clean up and improve documentation.</action>
</release>
1.15 +28 -21 maven-plugins/pmd/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/pmd/plugin.jelly,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- plugin.jelly 14 Apr 2004 00:55:25 -0000 1.14
+++ plugin.jelly 29 Jul 2004 14:31:30 -0000 1.15
@@ -111,28 +111,35 @@
violated and that causes the report generation to fail later on -->
<echo file="${maven.build.dir}/pmd-raw-report.xml"
message="<?xml version='1.0'?><pmd/>"/>
-
- <pmd rulesetfiles="${maven.pmd.rulesetfiles}">
- <formatter type="xml" toFile="${maven.build.dir}/pmd-raw-report.xml"/>
- <fileset dir="${pom.build.sourceDirectory}"
- includes="${maven.pmd.includes}"
- excludes="${maven.pmd.excludes}">
- <!-- FIXME: This is a bad cut and paste -->
- <!-- handle source modifications -->
- <j:forEach var="sm" items="${pom.build.sourceModifications}">
- <available property="classPresent" classname="${sm.className}"/>
- <j:if test="${classPresent != 'true'}">
- <j:forEach var="exclude" items="${sm.excludes}">
- <exclude name="${exclude}"/>
- </j:forEach>
- <j:forEach var="include" items="${sm.includes}">
- <include name="${include}"/>
+ <j:choose>
+ <j:when test="${sourcesPresent == 'true'}">
+ <pmd rulesetfiles="${maven.pmd.rulesetfiles}">
+ <formatter type="xml" toFile="${maven.build.dir}/pmd-raw-report.xml"/>
+ <fileset dir="${pom.build.sourceDirectory}"
+ includes="${maven.pmd.includes}"
+ excludes="${maven.pmd.excludes}">
+
+ <!-- FIXME: This is a bad cut and paste -->
+ <!-- handle source modifications -->
+ <j:forEach var="sm" items="${pom.build.sourceModifications}">
+ <available property="classPresent" classname="${sm.className}"/>
+ <j:if test="${classPresent != 'true'}">
+ <j:forEach var="exclude" items="${sm.excludes}">
+ <exclude name="${exclude}"/>
+ </j:forEach>
+ <j:forEach var="include" items="${sm.includes}">
+ <include name="${include}"/>
+ </j:forEach>
+ </j:if>
</j:forEach>
- </j:if>
- </j:forEach>
- </fileset>
- </pmd>
+ </fileset>
+ </pmd>
+ </j:when>
+ <j:otherwise>
+ <ant:echo>No java source files to process.</ant:echo>
+ </j:otherwise>
+ </j:choose>
<!-- Run JSL to transform the report into XDOC -->
@@ -149,7 +156,7 @@
<!-- Generate CPD report if it is enabled -->
<j:set var="enable" value="${maven.pmd.cpd.enable}"/>
- <j:if test="${enable == 'true'}">
+ <j:if test="${enable == 'true' and sourcesPresent == 'true'}">
<attainGoal name="pmd:cpd-report"/>
</j:if>
</goal>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org