When compiling a gradle project that uses the new Java 1.8 -parameters feature, the check task fails in some cases. I’ve created a small github example project that recreates the problem: https://github.com/seanjreilly/gradle-parameters-bug/ It requires Java 1.8, and with gradle 2.0 the test task fails when you run gradle clean build.
The error message and stacktrace produced are in [this gist] (https://gist.github.com/seanjreilly/086968ab04fbb339b562).
The error can be avoided by: * disabling the -parameters option when compiling (commenting out lines 15-17 in build.gradle) * commenting out the method (doTheThing) with parameters (commenting out lines 6-8 in TheTest.java) * moving the “doTheThing” method below the first org.junit.Test annotated test method in TheTest.java
Any ideas?
output of gradle -v:
------------------------------------------------------------
Gradle 2.0
------------------------------------------------------------
Build time:
2014-07-01 07:45:34 UTC
Build number: none
Revision:
b6ead6fa452dfdadec484059191eb641d817226c
Groovy:
2.3.3
Ant:
Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:
1.8.0_11 (Oracle Corporation 25.11-b03)
OS:
Mac OS X 10.9.4 x86_64