Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 1.7
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
It looks like the PMD plugin version 1.7 does NOT use maven.pmd.targetjdk, despite the documentation. This basically prevents PMD from working with any jdk1.5-specific featurs.
I have added the following lines in the plugin.jelly (line 107):
<j:set var="targetjdk" value="${maven.compile.source}"/>
<j:if test="${context.getVariable('maven.pmd.targetjdk')!=''}">
<j:set var="targetjdk" value="${maven.pmd.targetjdk}"/>
</j:if>
<echo>Running the PMD task with ${maven.pmd.rulesetfiles} ... Target:${targetjdk}</echo>
<!-- Prepare empty raw report because no file is generated if no rule is
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/>"/>
<j:choose>
<j:when test="${sourcesPresent == 'true'}">
<pmd rulesetfiles="${maven.pmd.rulesetfiles}" targetjdk="${targetjdk}">
...
---------------------
I trust that this would fix the issue (it does in my environment).
Issue Links
| This issue duplicates: | ||||
| MPPMD-19 | Java language level not settable through plugin |
|
|
|
Already fixed in CVS/Subversion.
maven plugin:download -Dmaven.repo.remote=http://www.ibiblio.org/maven,http://cvs.apache.org/repository/ -DgroupId=maven -DartifactId=maven-pmd-plugin -Dversion=1.8-SNAPSHOT