本文整理了Java中hudson.model.AbstractProject.getJDK()
方法的一些代码示例,展示了AbstractProject.getJDK()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractProject.getJDK()
方法的具体详情如下:
包路径:hudson.model.AbstractProject
类名称:AbstractProject
方法名:getJDK
暂无
代码示例来源:origin: jenkinsci/jenkins
@Override
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(node, listener);
JDK jdkTool = getJDK();
if (jdkTool != null) {
if (node != null) { // just in case were not in a build
jdkTool = jdkTool.forNode(node, listener);
}
jdkTool.buildEnvVars(env);
} else if (!JDK.isDefaultName(jdk)) {
listener.getLogger().println("No JDK named ‘" + jdk + "’ found");
}
return env;
}
代码示例来源:origin: org.jenkins-ci.plugins/matrix-project
/**
* @see #getJDKs()
*/
@Override @Deprecated
public JDK getJDK() {
return super.getJDK();
}
代码示例来源:origin: SonarSource/sonar-scanner-jenkins
/**
* @return JDK to be used with this project.
*/
private JDK getJdkToUse(@Nullable AbstractProject<?, ?> project) {
JDK jdkToUse = getJdkFromJenkins();
if (jdkToUse == null && project != null) {
jdkToUse = project.getJDK();
}
return jdkToUse;
}
代码示例来源:origin: jenkinsci/promoted-builds-plugin
@Override public JDK getJDK() {
return getOwner().getJDK();
}
代码示例来源:origin: jenkinsci/zap-plugin
/**
* @return JDK to be used with this project.
*/
private JDK getJdkToUse(AbstractProject<?, ?> project) {
JDK jdkToUse = getJDK();
if (jdkToUse == null) jdkToUse = project.getJDK();
return jdkToUse;
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
public EnvVars getEnvironment(Node node, TaskListener listener) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(node, listener);
JDK jdkTool = getJDK();
if (jdkTool != null) {
if (node != null) { // just in case were not in a build
jdkTool = jdkTool.forNode(node, listener);
}
jdkTool.buildEnvVars(env);
} else if (!JDK.isDefaultName(jdk)) {
listener.getLogger().println("No JDK named ‘" + jdk + "’ found");
}
return env;
}
代码示例来源:origin: jenkinsci/envinject-plugin
/**
* Gets JDK variables.
* For {@link AbstractBuild} it invokes operation on the node to retrieve the data;
* for other types it does nothing.
* @param run Run
* @param logger Logger
* @param result Target collection, where the variables will be added
* @throws IOException Operation failure
* @throws InterruptedException Operation has been interrupted
*/
public static void getJDKVariables(@Nonnull Run<?, ?> run, TaskListener logger, EnvVars result)
throws IOException, InterruptedException {
if (run instanceof AbstractBuild) {
AbstractBuild b = (AbstractBuild) run;
JDK jdk = b.getProject().getJDK();
if (jdk != null) {
Node node = b.getBuiltOn();
if (node != null) {
jdk = jdk.forNode(node, logger);
}
jdk.buildEnvVars(result);
}
}
}
代码示例来源:origin: jenkinsci/sbt-plugin
JDK jdk = build.getProject().getJDK();
Computer computer = Computer.currentComputer();
if (computer != null && jdk != null) { // just in case were not in a build
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(log);
FilePath ws = getWorkspace();
if (ws!=null) // if this is done very early on in the build, workspace may not be decided yet. see HUDSON-3997
env.put("WORKSPACE", ws.getRemote());
// servlet container may have set CLASSPATH in its launch script,
// so don't let that inherit to the new child process.
// see http://www.nabble.com/Run-Job-with-JDK-1.4.2-tf4468601.html
env.put("CLASSPATH","");
JDK jdk = project.getJDK();
if (jdk != null) {
Computer computer = Computer.currentComputer();
if (computer != null) { // just in case were not in a build
jdk = jdk.forNode(computer.getNode(), log);
}
jdk.buildEnvVars(env);
}
project.getScm().buildEnvVars(this,env);
if (buildEnvironments!=null)
for (Environment e : buildEnvironments)
e.buildEnvVars(env);
for (EnvironmentContributingAction a : Util.filter(getActions(),EnvironmentContributingAction.class))
a.buildEnvVars(this,env);
EnvVars.resolve(env);
return env;
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
@Override
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(log);
FilePath ws = getWorkspace();
if (ws!=null) // if this is done very early on in the build, workspace may not be decided yet. see HUDSON-3997
env.put("WORKSPACE", ws.getRemote());
// servlet container may have set CLASSPATH in its launch script,
// so don't let that inherit to the new child process.
// see http://www.nabble.com/Run-Job-with-JDK-1.4.2-tf4468601.html
env.put("CLASSPATH","");
JDK jdk = project.getJDK();
if (jdk != null) {
Computer computer = Computer.currentComputer();
if (computer != null) { // just in case were not in a build
jdk = jdk.forNode(computer.getNode(), log);
}
jdk.buildEnvVars(env);
}
project.getScm().buildEnvVars(this,env);
if (buildEnvironments!=null)
for (Environment e : buildEnvironments)
e.buildEnvVars(env);
for (EnvironmentContributingAction a : Util.filter(getActions(),EnvironmentContributingAction.class))
a.buildEnvVars(this,env);
EnvVars.resolve(env);
return env;
}
代码示例来源:origin: hudson/hudson-2.x
@Override
public EnvVars getEnvironment(TaskListener log) throws IOException, InterruptedException {
EnvVars env = super.getEnvironment(log);
FilePath ws = getWorkspace();
if (ws!=null) // if this is done very early on in the build, workspace may not be decided yet. see HUDSON-3997
env.put("WORKSPACE", ws.getRemote());
// servlet container may have set CLASSPATH in its launch script,
// so don't let that inherit to the new child process.
// see http://www.nabble.com/Run-Job-with-JDK-1.4.2-tf4468601.html
env.put("CLASSPATH","");
JDK jdk = project.getJDK();
if (jdk != null) {
Computer computer = Computer.currentComputer();
if (computer != null) { // just in case were not in a build
jdk = jdk.forNode(computer.getNode(), log);
}
jdk.buildEnvVars(env);
}
project.getScm().buildEnvVars(this,env);
if (buildEnvironments!=null)
for (Environment e : buildEnvironments)
e.buildEnvVars(env);
for (EnvironmentContributingAction a : Util.filter(getActions(),EnvironmentContributingAction.class))
a.buildEnvVars(this,env);
EnvVars.resolve(env);
return env;
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
JDK jdk = project.getJDK();
if (jdk != null) {
Computer computer = Computer.currentComputer();
内容来源于网络,如有侵权,请联系作者删除!