Launch Gradle 4.4.1 from Invoke Gradle script plugin from Jenkins

Hi,

i’m launching Gradle 4.4.1 from Invoke Gradle script plugin in Jenkins and I get this error: Error: Could not find or load main class build

But If I launch Gradle directly on Centos I achive the compilation successful.

What is happening?

Thanks!

Perhaps a related build script snippet and a mention of the task you are trying to run might help the non-psychic forum members

I’m only executing “build” task but If I select Gradle 2.0 it works and If I select Gradle 4.4.1 doesn’t work.

The build.gradle script is:
apply plugin: ‘java’
archivesBaseName = “quote”
version = ‘1.0-FINAL’
//apply plugin: ‘maven’

repositories {
maven{
url “https://repo.maven.apache.org/maven2
}

}

dependencies {
compile group: ‘org.apache.commons’, name: ‘commons-lang3’, version: ‘3.4’
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.+’
}

I don’t know why if I execute gradle 4.4.1 in a shell it works but from Jenkins only works Gradle 2.0.

I attach 2 images as evidences.!

What’s on lines 163 and 167 of build.gradle?

The line 167 in Gradle-4.4.1 is:
eval set – $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS “”-Dorg.gradle.appname=$APP_BASE_NAME"" -classpath “”$CLASSPATH"" org.gradle.launcher.GradleMain “$APP_ARGS”

and in Gradle-2.0 in line the 163 it is the same.

That’s not build.gradle