Since Jenkins 1.460, calling getMavenArtifacts() on the MavenBuild instance returns null, whereas earlier this would work fine.
Have there been changes to the Jenkins API, or is this a Jenkins bug?
The code I execute is a Groovy script post-build system that provides the Maven version of the build as an environment variable for the next steps in the Jenkins build process:
import hudson.model.*; import hudson.util.*; def thr = Thread.currentThread(); def currentBuild = thr?.executable; def mavenVer = currentBuild.getMavenArtifacts().getModuleRecords()[0].mainArtifact.version; def newParamAction = new hudson.model.ParametersAction(new hudson.model.StringParameterValue("MAVEN_VERSION", mavenVer)); currentBuild.addAction(newParamAction);
maven hudson jenkins groovy
EngineerBetter_DJ Apr 17 '12 at 16:17 2012-04-17 16:17
source share