我能够在Jenkins运行的命令提示符下运行gradlew test clean
。当我使用Gradle Wrapper并在Jenkins中运行clean test
时,作业失败了:
Execution failed for task ':compileJava'.
> invalid source release: 1.8
我的包装器使用的是gradleVersion = 1.10,而gradlew -v显示以下内容:
C:\Program Files (x86)\Jenkins\jobs\CDS-UnitTest\workspace>gradlew -v
------------------------------------------------------------
Gradle 1.10
------------------------------------------------------------
Build time: 2013-12-17 09:28:15 UTC
Build number: none
Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy: 2.2.0
JVM: 1.8.0_05 (Oracle Corporation 25.5-b02)
OS: Windows Server 2012 R2 6.3 amd64
我无法弄清楚为什么它在Jenkins中为JDK 1.8失败,而它在命令行中运行。
Jenkins控制台:
[workspace] $ cmd.exe /C '""C:\Program Files (x86)\Jenkins\jobs\CDS-UnitTest\workspace\gradlew.bat" -DSOURCE_BUILD_NUMBER=14 clean test && exit %%ERRORLEVEL%%"'
...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> invalid source release: 1.8