英文:
PMD in gradle how to exclude directories
问题
我已经在我的Gradle项目中设置了PMD。
我想要从扫描中排除特定目录。
我应该如何做到这一点?这是我的Gradle设置:
pmd {
toolVersion = "6.48.0"
sourceSets = listOf(java.sourceSets.findByName("main"))
ruleSetFiles = files("/ruleset.xml")
}
英文:
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")
}
答案1
得分: 1
以下是翻译好的部分:
"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'
]
}
}"
英文:
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'
]
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论