【发布时间】:2016-08-25 01:02:17
【问题描述】:
为什么这不起作用,我怎样才能得到我正在寻找的结果?具体来说,我希望 jacoco 在 sonarqube 之前运行。
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
test {
jacoco {
excludes = [...,
"javolution.*"]
}
}
jacocoTestReport {
dependsOn tasks.withType(Test)//This makes integrationTests go.
}
//This is the part that I can't get to work:
project.tasks["sonarqube"].dependsOn jacocoTestReport
}
错误是:
* Where:
Build file '/dev/abc/build.gradle' line: 92
* What went wrong:
A problem occurred evaluating root project 'abc'.
> Task with name 'sonarqube' not found in project ':thingamajig'.
当然thingamajig 是一个空的父目录。没有build.gradle,但它有许多子目录确实有build.gradle。我已经尝试了很多方法,比如检查任务图并在调用project.tasks.getByName() 时捕获异常,我猜是时候下注了。
【问题讨论】: