0

Error : Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

I am trying to create a pipeline using cloudbees core. But getting issue with following error :

Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

The error i am getting when trying to execute withMaven() piece of code

outside withMaven() all the following commands 

sh "echo $PATH"
sh "echo $JAVA_HOME"
sh "echo $MAVEN_HOME"
sh "echo $M3_HOME"
sh "mvn --version"
sh "java -version" 

are working fine. but when it is trying to execute withMaven()

then getting the error :

Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

 

Here is my pipeline 

node("checkout-and-build") {
stage('Get a Maven project') {
git 'https://github.com/cloudbees-community/game-of-life.git'
//checkout scm
container('checkout-and-build') {
stage('Build a Maven project') {
sh "echo $PATH"
sh "echo $JAVA_HOME"
sh "echo $MAVEN_HOME"
sh "echo $M3_HOME"
sh "mvn --version"
sh "java -version"

//steps {
//script {
// Run the maven build
withMaven(
//mavenLocalRepo: '.repository',
mavenSettingsConfig: 'cb61e328-dcee-4c95-b3e0-7a7c9d17187b'
//mavenSettingsConfig : 'NexusMavenSettings'
//jdk: 'java-1.8-openjdk',
//publisherStrategy: 'EXPLICIT'
) {
sh "java -version"
sh 'mvn -version'
}

//}
//}
//withMaven(mavenSettingsConfig:'cb61e328-dcee-4c95-b3e0-7a7c9d17187b') {
//sh 'mvn clean install'
//}
}
}
}


}
}

 

 

-- Any help to resolve the issue is welcome in advance

1 comment

Please sign in to leave a comment.