Maven 1.x PMD Plugin

PMD plugin does not work with JDK5 (missing property)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 1.7
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

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

Activity

Hide
Benoit Xhenseval added a comment -

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

Show
Benoit Xhenseval added a comment - 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
Hide
Arnaud Heritier added a comment -

Reopen to fix the resolution

Show
Arnaud Heritier added a comment - Reopen to fix the resolution

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: