Hi all,

Since an upgrade to Jenkins 1.460, a call to getMavenArtifacts() from an
instance of MavenBuild returns null. Prior to the upgrade, the following
post-build Groovy System script worked fine:

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);

Does anyone know why this would have broken with the upgrade? Should I be
using different classes instead?

-- 
Regards,
Daniel Jones | Software Engineer, Platform Team


Mendeley Ltd | London, UK | www.mendeley.com <http://www.mendeley.com/>
Registered in England and Wales | Company Number 6419015

Reply via email to