You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ah...@apache.org on 2006/02/02 18:52:18 UTC
svn commit: r374441 - in /maven/maven-1/plugins/trunk/pmd:
src/plugin-resources/pmd.jsl xdocs/changes.xml
Author: aheritier
Date: Thu Feb 2 09:51:54 2006
New Revision: 374441
URL: http://svn.apache.org/viewcvs?rev=374441&view=rev
Log:
Do not generate links to JXR files if they are not created.
Modified:
maven/maven-1/plugins/trunk/pmd/src/plugin-resources/pmd.jsl
maven/maven-1/plugins/trunk/pmd/xdocs/changes.xml
Modified: maven/maven-1/plugins/trunk/pmd/src/plugin-resources/pmd.jsl
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pmd/src/plugin-resources/pmd.jsl?rev=374441&r1=374440&r2=374441&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pmd/src/plugin-resources/pmd.jsl (original)
+++ maven/maven-1/plugins/trunk/pmd/src/plugin-resources/pmd.jsl Thu Feb 2 09:51:54 2006
@@ -121,19 +121,20 @@
<!-- Where JXR files are generated for the code -->
<j:set var="jxrDestDir" value="${maven.jxr.destdir}"/>
<util:replace var="jxrDestDir" value="${jxrDestDir}" oldChar="\\" newChar="/"/>
- <!-- We create a relative path to the jxr files -->
- <!-- ${maven.jxr.destdir} should be a subdirectory of ${maven.docs.dest} -->
+ <util:file var="jxrDestDirFile" name="${jxrDestDir}"/>
<j:choose>
- <j:when test="${jxrDestDir.startsWith(docsDestDir)}">
- <j:set var="jxrDestDir" value="${jxrDestDir.substring(docsDestDir.length(),jxrDestDir.length())}"/>
- <!-- remove first slash if needed -->
- <j:if test="${jxrDestDir.startsWith('/')}">
- <j:set var="jxrDestDir" value="${jxrDestDir.substring(1,jxrDestDir.length())}"/>
- </j:if>
+ <j:when test="${jxrDestDirFile.exists() and jxrDestDir.startsWith(docsDestDir)}">
+ <!-- We create a relative path to the jxr files -->
+ <!-- ${maven.jxr.destdir} should be a subdirectory of ${maven.docs.dest} -->
+ <j:set var="jxrDestDir" value="${jxrDestDir.substring(docsDestDir.length(),jxrDestDir.length())}"/>
+ <!-- remove first slash if needed -->
+ <j:if test="${jxrDestDir.startsWith('/')}">
+ <j:set var="jxrDestDir" value="${jxrDestDir.substring(1,jxrDestDir.length())}"/>
+ </j:if>
</j:when>
<j:otherwise>
- <!-- Use a default value :-( -->
- <j:set var="jxrDestDir" value="xref2"/>
+ <!-- Do not generate the link -->
+ <j:set var="jxrDestDir" value=""/>
</j:otherwise>
</j:choose>
</j:if>
@@ -141,19 +142,20 @@
<!-- Where JXR files are generated for the tests -->
<j:set var="jxrTestDestDir" value="${maven.jxr.destdir.test}"/>
<util:replace var="jxrTestDestDir" value="${jxrTestDestDir}" oldChar="\\" newChar="/"/>
- <!-- We create a relative path to the jxr files for tests -->
- <!-- ${maven.jxr.destdir.test} should be a subdirectory of ${maven.docs.dest} -->
+ <util:file var="jxrTestDestDirFile" name="${jxrTestDestDir}"/>
<j:choose>
- <j:when test="${jxrTestDestDir.startsWith(docsDestDir)}">
- <j:set var="jxrTestDestDir" value="${jxrTestDestDir.substring(docsDestDir.length(),jxrTestDestDir.length())}"/>
- <!-- remove first slash if needed -->
- <j:if test="${jxrTestDestDir.startsWith('/')}">
- <j:set var="jxrTestDestDir" value="${jxrTestDestDir.substring(1,jxrTestDestDir.length())}"/>
- </j:if>
+ <j:when test="${jxrTestDestDirFile.exists()} and jxrTestDestDir.startsWith(docsDestDir)">
+ <!-- We create a relative path to the jxr files for tests -->
+ <!-- ${maven.jxr.destdir.test} should be a subdirectory of ${maven.docs.dest} -->
+ <j:set var="jxrTestDestDir" value="${jxrTestDestDir.substring(docsDestDir.length(),jxrTestDestDir.length())}"/>
+ <!-- remove first slash if needed -->
+ <j:if test="${jxrTestDestDir.startsWith('/')}">
+ <j:set var="jxrTestDestDir" value="${jxrTestDestDir.substring(1,jxrTestDestDir.length())}"/>
+ </j:if>
</j:when>
<j:otherwise>
- <!-- Use a default value :-( -->
- <j:set var="jxrTestDestDir" value="xref-test2"/>
+ <!-- Do not generate the link -->
+ <j:set var="jxrTestDestDir" value=""/>
</j:otherwise>
</j:choose>
</j:if>
Modified: maven/maven-1/plugins/trunk/pmd/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/pmd/xdocs/changes.xml?rev=374441&r1=374440&r2=374441&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/pmd/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/pmd/xdocs/changes.xml Thu Feb 2 09:51:54 2006
@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.8-SNAPSHOT" date="In SVN">
+ <action dev="aheritier" type="fix">Do not generate links to JXR files if they are not created.</action>
<action dev="aheritier" type="update">Use properties maven.jxr.destdir and maven.jxr.destdir.test to generate links from the PMD report to jxr files.</action>
<action dev="aheritier" type="fix">Fix NullPointerException if pom.build.sourceDirectory or pom.build.unitTestSourceDirectory are not defined.</action>
<action dev="aheritier" type="update">Upgrade to pmd-3.4.</action>