Launch Gradle 4.4.1 from Invoke Gradle script plugin from Jenkins


(Valderrama) #1

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!


(uklance) #2

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


(Valderrama) #3

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.!


(Valderrama) #4


(uklance) #5

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


(Valderrama) #6

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.


(uklance) #7

That’s not build.gradle