我已经在build.gradle中设置了源目录和测试实现,但是jenkins不运行compiletestgroovy。例如,在我的构建脚本中,我根本看不到compiletestgroovy在运行(甚至没有跳过)。
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :
/home/jenkins/agent/workspace/test-pickup/build/ui/kat-frompick-ui-21.10.10.jar
> Task :compileGroovy
> Task :compileJava NO-SOURCE
> Task :copyToLib
> Task :unzip
> Task :processResources
> Task :classes
> Task :bootWarMainClassName
> Task :bootWar
> Task :war SKIPPED
> Task :assemble
> Task :check
> Task :build
> Task :generatePomFileForMavenJavaPublication
> Task :artifactoryPublish
相关build.gradle:
sourceSets {
test {
groovy {
srcDirs = ['src/test/groovy']
}
}
}
tasks.named('compileGroovy') {
// Groovy only needs the declared dependencies
// (and not longer the output of compileJava)
classpath = sourceSets.main.compileClasspath
}
tasks.named('compileTestGroovy') {
// Groovy only needs the declared dependencies
// (and not longer the output of compileTestJava)
classpath = sourceSets.main.compileClasspath
}
以及我的依赖关系
implementation "org.springframework:spring-beans"
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: '2.4.3'
testImplementation group:"org.springframework.boot", name:"spring-boot-starter-test", version:'2.4.3'
testImplementation('org.spockframework:spock-core:2.0-M2-groovy-3.0')
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation ('org.codehaus.groovy:groovy-all:3.0.7')
testImplementation group: 'cglib', name: 'cglib-nodep', version: '3.2.4'
gradle版本是6.8.2。对于testimplementation,compiletest任务应该作为groovy gradle插件的一部分运行。我已经用尽了所有的选择。
注意:这在本地运行,而不是在Jenkins。
暂无答案!
目前还没有任何答案,快来回答吧!