With Gradle 1.5 - PMD applying basic rules even when they are not included in our rule set files

(Abhishek Nath) #1

We have pmdMain configuration like this:

pmdMain {

ruleSets = []

ruleSetFiles = files([















After 1.5 upgrade builds have started failing with rules not included in our rule set files. For example: [Basic Rules.CollapsibleIfStatements] - These nested if statements could be combined

This rule is not defined in any of our ruleset files. Any help is appreciated.

(Peter Niederwieser) #2

Looks like a regression to me, and so far I haven’t found a workaround. We’ll keep you informed.

(Abhishek Nath) #3

Is there a chance this be fixed in RC2? Or should we rollback to 1.4.

(Peter Niederwieser) #4

If there is an RC2, it will contain a fix for this issue. We should know soon enough. In the meantime, you could try to work around with 'ruleSets = [


“$projectRoot/buildtools/pmd-rules/strictexception.xml”, …]’. I haven’t tested this, but it might work.

(Abhishek Nath) #5

Awesome. That works. Thanks.

(Andreas Feldschmid) #6

Still seems to be an issue with 1.10 The workaround does work however…