我正在做POC工作,从Gradle 1.6迁移到2.1 (基本上是为了解决这个问题:Gradle build / test failed - kryo.KryoException: Buffer overflow )。
Gradle 1.6成功地构建了
在使用Gradle 2.1时,当我运行"gradle clean“时,我会得到以下错误消息。
FAILURE: Build failed with an exception.
* Where:
Initialization script '/production/gradle-2.1/init.d/extra1.common-thids.gradle' line: 19
* What went wrong:
Could not find property 'Compile' on root project 'Infrastructure'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
和
:findbugsMain FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':findbugsMain'.
> The version of FindBugs (3.0.0) inferred from FindBugs classpath is too high to work with currently used Java version (1.6). Please use lower version of FindBugs or use newer version of Java. Inspected FindBugs classpath: [findbugs-3.0.0.jar, bcel-findbugs-6.0.jar, annotations-3.0.0.jar, jFormatString-3.0.0.jar, dom4j-1.6.1.jar, jaxen-1.1.6.jar, asm-debug-all-5.0.2.jar, commons-lang-2.6.jar, xml-apis-1.0.b2.jar]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
全球水平init.d/ex1.常见的gradle文件行是:,我使用了相同的init.d文件(用于存储库设置和其他全局设置,与Gradle 1.6一起使用,它应用了findbug、pmd、java等插件)。我将debug设置为true,这样jacoco可以生成代码覆盖率。知道吗,如何使用Gradle 2.1将选项debug设置为true?
对于findbug问题,我不想将JAVA/JDK版本从1.6升级到1.7.0 40 (此时,这个核心项目的工件被JavaJDK1.6上的其他项目所消耗)。谢谢。
18
19 tasks.withType(Compile) {
20 options.debug = true
21 options.compilerArgs = ["-g"]
22 }
23
发布于 2014-11-07 07:03:34
Compile
被重命名为JavaCompile
。要使用的FindBugs版本可以通过findbugs { toolVersion = "x.y.z" }
进行配置。
https://stackoverflow.com/questions/26790831
复制相似问题