Skip to content

Problem with PMD plugin in Gradle #4145

Answered by adangel
mariometushev asked this question in Q&A
Discussion options

You must be logged in to vote

By the way, this should be easier with gradle 8. They improved the configuration (see gradle/gradle#22211)

According to the current documentation https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.Pmd.html#org.gradle.api.plugins.quality.Pmd there seems to be a third parameter called ruleSetConfig. Maybe setting ruleSets = [] and using ruleSetConfig instead of ruleSetFiles helps?

I tried it out myself and it works as it should - only the custom ruleset is used:

plugins {
    id 'pmd'
}

pmd {
    consoleOutput = true
    toolVersion = "6.45.0"
    ruleSets = []
    ruleSetFiles = files("${project.rootDir}/custom-ruleset.xml")
}
complete ruleset custom-ruleset.xml
<ruleset n…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mariometushev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants