Hi All,Ant-Skript mit PMD-Check nicht zu erkennen JDK 1,8
I am currently working on a legacy system and moving the current version of jdk to 1.8. Earlier our ant script was like this to apply the pmd checks :
<target name="check-pmd-writable-force" unless="git.scm">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${basedir}/tools/pmd/pmd-java-4.2.2.jar"/>
<pmd rulesetfiles="${basedir}/tools/rulesets.xml" targetjdk="1.5">
<formatter type="html" toFile="${basedir}/pmd_report.html" toConsole="false"/>
<formatter type="text" toConsole="true"/>
<fileset dir="${workmanager.dir.src}">
<patternset refid="sources-no-tests"/>
<custom classname="com.osm.tools.ant.AntWritableSelector" classpath="${workmanager.ant.tools}"/>
</fileset>
</pmd>
</target>
But as I am moving our application to jdk 1.8 pmd is showing some error/warning which I need to resolve. So I cahanged the ant script with the latest change below:
But doing so gives me the below error:
The targetjdk attribute, if used, must be set to either '1.3', '1.4', '1.5', '1.6', '1.7' or 'jsp'
I searched a lot and tried adding the below line after taskdef line but end up getting another error.
<sourceLanguage name="java" version="1.8"/>
Any idea how to make my above configuration for pmd to work with jdk 1.8
Welche Version von [PMD] (https://pmd.github.io/) verwenden Sie wäre? Vielleicht ist es zu alt, um die Java-8-Syntax zu unterstützen (z. B. Lambdas). – howlger
Ich habe zu PMD 5.8.1 gewechselt aber pmd unterstützt das Attribut "targetjdk" nicht – vibhas
Ja, die Ant-Task hat sich geändert, benutze ' ' stattdessen: https : //pmd.github.io/pmd-5.8.1/usage/ant-task.html –
howlger