我正在做从Gradle 1.6迁移到2.1的POC工作(基本上是为了解决这个问题:Gradle build / test failed - kryo.KryoException: Buffer overflow)的数据。
Gradle构建与Gradle 1.6成功配合使用
使用Gradle 2.1,当我运行“gradle clean build”时,我收到以下错误消息。
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/extra 1...常见的Gradle文件行是:**我使用了相同的init.d文件(用于存储库设置和其他全局设置,与我在Gradle 1.6中使用的相同,Gradle 1.6具有findbugs、pmd、java等应用插件)。我将debug设置为true,以便jacoco可以生成代码覆盖率。
对于findbugs问题,我不想将JAVA/JDK版本从1.6升级到1.7.0 40(此时 core 项目的工件被其他仍然在JAVA JDK 1.6上的项目使用)。谢谢。
18
19 tasks.withType(Compile) {
20 options.debug = true
21 options.compilerArgs = ["-g"]
22 }
23
1条答案
按热度按时间svgewumm1#
Compile
已重命名为JavaCompile
要使用FindBugs版本可以通过findbugs { toolVersion = "x.y.z" }
进行配置