GeezerVison is showing github.com — [core] Shortnames parameter does not work with Ant · Issue #2062 · pmd/pmd
[core] Shortnames parameter does not work with Ant #2062
Labels
a:bugPMD crashes or fails to analyse a file. Description
Affects PMD Version:
6.18.0
Rule:
N/A
Description:
I previously was able to run the short-names parameter in my ant buildscript and it would output in the report with the relative path. In 6.18.0 it appears that shortnames has stopped working with Ant. The short-names parameter does work with the PMD CLI however.
Code Sample demonstrating the issue:
<target name="pmd">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
<classpath>
<fileset dir="${pmdLibFolder}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<pmd shortFilenames="true" cacheLocation="pmd.cache">
<formatter type="xml" toFile="pmd_report.xml" toConsole="true"/>
<ruleset>ruleset.xml</ruleset>
<fileset dir="${src}">
<include name="**/Application.java"/>
</fileset>
</pmd>
</target>
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Ant
Activity
adangel commented on Oct 16, 2019
Seems to be a regression of #1923
The parameter has moved to the renderers, since shortnames is just relevant for the renderers. But the renderers in the ant task are created in a different way than the renderers created by the cli. So the renderers in the ant task know nothing about shortnames and the directory prefix, that should be removed.
There is also no unit test for this feature used via a ant task.
changed the title
[-][core] Shortnames parameter does not work with Ant buildscript[/-] [+][core] Shortnames parameter does not work with Ant[/+] on Nov 8, 2019added a commit that references this issue
on Nov 8, 2019This issue will close once commit 2541e22 is merged into the 'main' branch.2541e22
Metadata
Metadata
a:bugPMD crashes or fails to analyse a file. Development
No branches or pull requestsIssue actions