Пакеты Jenkins в Groovy Classpath?

При использовании подключаемого модуля Groovy Jenkins (а не подключаемого модуля Groovy Post Build, который является другой вещью) в качестве пост-этапа я не могу разрешить классы в Пакет hudson.model.

Нужно ли добавлять Jenkins .war в путь к классам или эти пакеты уже должны быть там?

Скрипт:

import hudson.model.*;
import hudson.util.*;

AbstractBuild currentBuild = (AbstractBuild) Thread.currentThread().executable;
def mavenVer = currentBuild.getMavenArtifacts().getModuleRecords()[0].mainArtifact.version;
println mavenVer;
ParametersAction newParamAction = new hudson.model.ParametersAction(new hudson.model.StringParameterValue(“MAVEN_VERSION”, mavenVer));
currentBuild.addAction(newParamAction);

Вывод:

[Common] $ /home/tester/tools/Groovy_1.8.3/bin/groovy /home/tester/workspace/Common/hudson8369102960709507246.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/home/tester/workspace/Common/hudson8369102960709507246.groovy: 8: unable to resolve class AbstractBuild 
 @ line 8, column 15.
   AbstractBuild currentBuild = (AbstractBuild) Thread.currentThread().executable;
[...]
5
задан EngineerBetter_DJ 3 April 2012 в 15:16
поделиться