So I have set up PMD with in my gradle project.
I want to exclude certain directories from the scan?
How can i do that, this is my gradle setup
pmd {
toolVersion = "6.48.0"
sourceSets = listOf(java.sourceSets.findByName("main"))
ruleSetFiles = files("/ruleset.xml")
}
Let's say you want to exclude your java's application file from the task pmdMain, one way you could do that is by writing the following configuration:
pmd {
toolVersion = "6.48.0"
sourceSets = listOf(java.sourceSets.findByName("main"))
ruleSetFiles = files("/ruleset.xml")
pmdMain {
excludes = [
'**/name-of-your-application-file.java'
]
}
}