I'm doing POC work from migrating from Gradle 1.6 to 2.1 (basically to resolve this issue: Gradle build / test failed - kryo.KryoException: Buffer overflow ).
Gradle build works successfully with Gradle 1.6
With Gradle 2.1, when I'm running "gradle clean build", I'm getting the following error messages.
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
and
: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
Global level init.d/extra1... common gradle file lines are: I used the same init.d files (for repository settings and other global settings what I used with Gradle 1.6 which has apply plugins like findbugs, pmd, java etc etc). I set debug to true so that jacoco can produce code coverage. Any idea, how can I set option debug to true with Gradle 2.1?
For findbugs issue, I don't want to upgrade JAVA/JDK version from 1.6 to 1.7.0 40 (at this time as this core project's artifact is consumed by other projects which are still on JAVA JDK 1.6). Thanks.
18
19 tasks.withType(Compile) {
20 options.debug = true
21 options.compilerArgs = ["-g"]
22 }
23
Compile
was renamed to JavaCompile
. FindBugs version to be used can be configured via findbugs { toolVersion = "x.y.z" }
.