无法在gradle中运行多个插件

时间:2013-06-14 21:39:42

标签: gradle findbugs checkstyle pmd build.gradle

我在gradle.build文件中配置了pmd,checkstyle和findbugs插件,因为我想保持代码行的质量。

我的build.gradle属性的一部分是:

task wrapper(type: Wrapper) {
description = "Generates gradlew (for internal use only)"
gradleVersion = '1.5'
jarFile = 'wrapper/wrapper.jar'
}

subprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'findbugs' //TODO: disable findbugs & checkstyle by default.
apply plugin: 'checkstyle'
apply plugin: 'pmd'

pmd.ignoreFailures = true
findbugs.ignoreFailures = true

findbugsMain.enabled = true
findbugsTest.enabled = true

checkstyleTest.enabled = true
checkstyleMain.enabled = true

checkstyle {
   configFile = new File(rootDir, "config/checkstyle/checkstyle.xml")
   ignoreFailures = true
}

我的目的是获取pmd,findbugs和checkstyle的所有警告/错误。

我正在尝试 gradlew check ,但我无法看到任何特定行为。有时候,独自一人会跑步。

有人可以建议我失踪的地方吗?

提前致谢, Vijay Bhore

1 个答案:

答案 0 :(得分:0)

让你列出

的输出
./gradlew check 

调用。通常这应该有效,但手动启用任务(例如'findbugsMain.enabled = true')并不是必需的。

欢呼声,