I am new to Gradle. In order to support Java 17 on Jenkins agent , I upgraded gradle to 7.3 version from 5.4. I also updated build.gradle to change compile
, runtime
, testCompile
, and testRuntime
into implementation
, runtimeOnly
, testImplementation
, and testRuntimeOnly
respectively.
And tried to run ./gradlew clean test in my project but it shows up this error :
./gradlew clean test --stacktrace
> Task :compileTestGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileTestGroovy'.
> Could not resolve all files for configuration ':testCompileClasspath'.
> Could not find org.jenkins-ci.main:cli:1.651.2.dalvizu.
Searched in the following locations:
- https://art01.corp.pingidentity.com/artifactory/inhouse/org/jenkins-ci/main/cli/1.651.2.dalvizu/cli-1.651.2.dalvizu.pom
- https://repo.jenkins-ci.org/releases/org/jenkins-ci/main/cli/1.651.2.dalvizu/cli-1.651.2.dalvizu.pom
- https://repo.maven.apache.org/maven2/org/jenkins-ci/main/cli/1.651.2.dalvizu/cli-1.651.2.dalvizu.pom
- file:/Users/nbirajadar/.m2/repository/org/jenkins-ci/main/cli/1.651.2.dalvizu/cli-1.651.2.dalvizu.pom
- https://jcenter.bintray.com/org/jenkins-ci/main/cli/1.651.2.dalvizu/cli-1.651.2.dalvizu.pom
Required by:
project : > org.jenkins-ci.main:jenkins-core:1.651.2.dalvizu
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileTestGroovy'.
This is the part of build.gradle file :
plugins {
id 'groovy'
id 'idea'
}
final String PLUGINS_DIR = 'build/classes/test/test-dependencies/';
repositories {
maven { url 'https://art01.corp.pingidentity.com/artifactory/inhouse/' }
maven { url 'https://repo.jenkins-ci.org/releases/' }
mavenCentral()
mavenLocal()
jcenter()
}
clean.doLast {
def target = new File("target");
if (target.exists()) {
target.deleteDir()
}
}
configurations {
jenkinsPluginDependencies
}
sourceSets {
jobs {
compileClasspath = configurations.implementation + sourceSets.main.output
groovy {
srcDirs 'jobs'
}
}
}
ext {
jenkinsVersion = "1.651.2.dalvizu"
I verified the inhouse/org/jenkins-ci/main/cli/1.651.2.dalvizu location just has [cli-1.651.2.dalvizu.jar]
How to resolve the issue now? Thank you in advance.