When the following mavenJob is executed as job
mavenJob('check-bom-dependencies') {
description 'Maven Job checking the BOM dependencies of the Spring Boot project'
...
preBuildSteps {
groovyCommand(readFileFromWorkspace('backupPOM.groovy')) {
groovyInstallation('groovy-3.0.7')
}
}
then we got the following error
[check-bom-dependencies] $ "/var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h6296654658095391056/groovy-3.0.7/bin/groovy" "/var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h6296654658095391056/workspace/check-bom-dependencies/hudson5004440412061931297.groovy"
Error: Could not find or load main class h6296654658095391056.groovy-3.0.7.lib.groovy.icns
Build step 'Execute Groovy script' marked build as failure
using jenkins 2.271 (where jenkins is launched using jenkinsrule) with the following code to install groovy
public class MavenCheckBOMJobDSLTest {
@Rule
public JenkinsRule j = new JenkinsRule();
String seedJobName = "maven-seed-job";
@Before
// Install Groovy to the Jenkins Global Configuration Tools as it is needed by the mavenJob
// As no utility class exists to fetch groovy, then we will deploy it from a local resource zip file
public void setUpGroovy() throws Exception {
FilePath home = j.jenkins.getRootPath();
home.unzipFrom(MavenCheckBOMJobDSLTest.class.getResourceAsStream("/groovy-binary-3.0.7.zip"));
j.jenkins.getDescriptorByType(GroovyInstallation.DescriptorImpl.class).setInstallations(new GroovyInstallation("groovy-3.0.7", home.child("groovy-3.0.7").getRemote(), null));
}
Originally reported by
cmoulliard, imported from: Could not find or load main class h6296654658095391056.groovy-3.0.7.lib.groovy.icns
- assignee: vjuranek
- status: Open
- priority: Minor
- component(s): groovy-plugin
- resolution: Unresolved
- votes: 0
- watchers: 1
- imported: 20260604-161841
Raw content of original issue
When the following mavenJob is executed as job
mavenJob('check-bom-dependencies') {
description 'Maven Job checking the BOM dependencies of the Spring Boot project'
...
preBuildSteps {
groovyCommand(readFileFromWorkspace('backupPOM.groovy')) {
groovyInstallation('groovy-3.0.7')
}
}
then we got the following error
[check-bom-dependencies] $ "/var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h6296654658095391056/groovy-3.0.7/bin/groovy" "/var/folders/t2/jwchtqkn5y76hrfrws7dqtqm0000gn/T/j h6296654658095391056/workspace/check-bom-dependencies/hudson5004440412061931297.groovy"
Error: Could not find or load main class h6296654658095391056.groovy-3.0.7.lib.groovy.icns
Build step 'Execute Groovy script' marked build as failure
using jenkins 2.271 (where jenkins is launched using jenkinsrule) with the following code to install groovy
public class MavenCheckBOMJobDSLTest {
@Rule
public JenkinsRule j = new JenkinsRule();
<span class="code-object">String</span> seedJobName = <span class="code-quote">"maven-seed-job"</span>;
@Before
<span class="code-comment">// Install Groovy to the Jenkins Global Configuration Tools as it is needed by the mavenJob
// As no utility class exists to fetch groovy, then we will deploy it from a local resource zip file
public void setUpGroovy() throws Exception {
FilePath home = j.jenkins.getRootPath();
home.unzipFrom(MavenCheckBOMJobDSLTest.class.getResourceAsStream("/groovy-binary-3.0.7.zip"));
j.jenkins.getDescriptorByType(GroovyInstallation.DescriptorImpl.class).setInstallations(new GroovyInstallation("groovy-3.0.7", home.child("groovy-3.0.7").getRemote(), null));
}
When the following mavenJob is executed as job
then we got the following error
using jenkins 2.271 (where jenkins is launched using jenkinsrule) with the following code to install groovy
Originally reported by
cmoulliard, imported from: Could not find or load main class h6296654658095391056.groovy-3.0.7.lib.groovy.icns
Raw content of original issue