-
Bug
-
Resolution: Unresolved
-
Minor
-
None
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)); }