Gradle: Setting PMD Arguments minimumPriority and shortFilenames

359 views Asked by At

Is it possible to specifiy minimumPriority and/or shortFilenames with the Gradle PMD plugin? I want to migrate a build from Ant to Gradle, and I had an Ant task which specified these Attributes like this:

<target name="pmd">
    <pmd shortFilenames="true" rulesetfiles="pmd-ruleset-base.xml" minimumPriority="2"> 
        ... 
    </pmd>
</target>

I would like to use Gradles features and plugins instead of reusing this Ant task, but didn't find a setting in the PmdExtension for this. Is there any other way to specifiy these Attributes? Do I overlook something? I use Gradle 2.4. Thanks in advance.

1

There are 1 answers

0
mgoetz On BEST ANSWER

Since Gradle 2.8, at least the minimumPriority can be set in the pmdExtension:

pmd {
    rulePriority = 3
}

See https://docs.gradle.org/2.8/release-notes#configuration-of-the-rule-priority-threshold-for-pmd