我在运行一个Gradle任务时遇到此错误。
:46:52 * Where:
14:46:52 Initialization script '/production/builds/jenkins_slave01/gradle-1.6/init.d/extra1.common-thids.gradle' line: 119
14:46:52
14:46:52 * What went wrong:
14:46:52 Could not compile initialization script '/production/builds/jenkins_slave01/gradle-1.6/init.d/extra1.common-thids.gradle'.
14:46:52 > startup failed:
14:46:52 initialization script '/production/builds/jenkins_slave01/gradle-1.6/init.d/extra1.common-thids.gradle': 119: expecting anything but ''\n''; got it anyway @ line 119, column 57.
14:46:52 ("$buildDir/reports/tests/IT")
14:46:52 ^
14:46:52
14:46:52 1 error
14:46:52
14:46:52
14:46:52 * Try:
14:46:52 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
14:46:52
14:46:53 BUILD FAILED
此任务背后的Gradle代码是:
task integrationTest( type: Test) {
/Alway run tests
outputs.upToDateWhen { false }
ignoreFailuers = true
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
testReportDir = file("$buildDir/reports/tests/IT")
testResultsDir = file("$buildDir/test-results/IT")
// This section in integrationTest and acceptanceTest task is actually not required here as jacocoagent.jar will be passed to Tomcat JVM instance than Gradle's instance.
// Following Jacoco section is required only in Jenkins
// But a developer can uncomment them if they want this feature to work for their
// Desktop local Gradle builds.
// This section in integrationTest and acceptanceTest task is actually not required here as jacocoagent.jar will be passed to Tomcat JVM instance than Gradle's instance.
//jacoco {
//The following vars works ONLY with 1.6 of Gradle
//destPath = file("$buildDir/jacoco/IT/jacocoIT.exec")
//classDumpPath = file("$buildDir/jacoco/UT/classpathdumps") --- commenting this out so we don't get errors - MG
//
//Following vars works only with versions >= 1.7 version of Gradle
//destinationFile = file("$buildDir/jacoco/UT/jacocoUT.exec")
// classDumpFile = file("$buildDir/jacoco/UT/classpathdumps")
//}
}
答案 0 :(得分:1)
哦哦..我因为错误的&#34; 或&#39; 或} 或<而错了我的头脑强> {或括号但忘记了一件简单的事情。
/Alway run tests
上面的COMMENT行应该如下所示,即我错过了 / 。
//Alway run tests