hudson.model.JDK.forEnvironment()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(197)

本文整理了Java中hudson.model.JDK.forEnvironment()方法的一些代码示例,展示了JDK.forEnvironment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDK.forEnvironment()方法的具体详情如下:
包路径:hudson.model.JDK
类名称:JDK
方法名:forEnvironment

JDK.forEnvironment介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/maven-plugin

@CheckForNull
public JDK getJava(TaskListener log) throws IOException, InterruptedException {
  JDK jdk = mms.getJDK();
  if (jdk != null) jdk = jdk.forNode(getCurrentNode(), log).forEnvironment(envVars);
  return jdk;
}

代码示例来源:origin: org.jvnet.hudson.main/maven-plugin

public JDK getJava(TaskListener log) throws IOException, InterruptedException {
  JDK jdk = mms.getJDK();
  if (jdk != null) jdk = jdk.forNode(getCurrentNode(), log).forEnvironment(envVars);
  return jdk;
}

代码示例来源:origin: jenkinsci/pipeline-maven-plugin

/**
 * Setup the selected JDK. If none is provided nothing is done.
 */
private void setupJDK() throws AbortException, IOException, InterruptedException {
  String jdkInstallationName = step.getJdk();
  if (StringUtils.isEmpty(jdkInstallationName)) {
    console.println("[withMaven] using JDK installation provided by the build agent");
    return;
  }
  if (withContainer) {
    // see #detectWithContainer()
    LOGGER.log(Level.FINE, "Ignoring JDK installation parameter: {0}", jdkInstallationName);
    console.println("WARNING: \"withMaven(){...}\" step running within a container," +
        " tool installations are not available see https://issues.jenkins-ci.org/browse/JENKINS-36159. " +
        "You have specified a JDK installation \"" + jdkInstallationName + "\", which will be ignored.");
    return;
  }
  console.println("[withMaven] using JDK installation " + jdkInstallationName);
  JDK jdk = Jenkins.getInstance().getJDK(jdkInstallationName);
  if (jdk == null) {
    throw new AbortException("Could not find the JDK installation: " + jdkInstallationName + ". Make sure it is configured on the Global Tool Configuration page");
  }
  Node node = getComputer().getNode();
  if (node == null) {
    throw new AbortException("Could not obtain the Node for the computer: " + getComputer().getName());
  }
  jdk = jdk.forNode(node, listener).forEnvironment(env);
  jdk.buildEnvVars(envOverride);
}

相关文章