jenkins.model.Jenkins.getJDK()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(213)

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

Jenkins.getJDK介绍

[英]Gets the JDK installation of the given name, or returns null.
[中]获取给定名称的JDK安装,或返回null。

代码示例

代码示例来源:origin: jenkinsci/jenkins

  1. /**
  2. * Gets the JDK that this project is configured with, or null.
  3. */
  4. public JDK getJDK() {
  5. return Jenkins.getInstance().getJDK(jdk);
  6. }

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

  1. /**
  2. * Gets the JDK that this project is configured with, or null.
  3. */
  4. public JDK getJDK() {
  5. return Jenkins.getInstance().getJDK(jdk);
  6. }

代码示例来源:origin: SonarSource/sonar-scanner-jenkins

  1. /**
  2. * Gets the JDK that this Sonar builder is configured with, or null.
  3. */
  4. @CheckForNull
  5. public JDK getJdkFromJenkins() {
  6. return Jenkins.getInstance().getJDK(jdk);
  7. }

代码示例来源:origin: SonarSource/sonar-scanner-jenkins

  1. /**
  2. * Gets the JDK that this Sonar publisher is configured with, or null.
  3. */
  4. private JDK getJDK() {
  5. return Jenkins.getInstance().getJDK(jdk);
  6. }

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

  1. public JDK getJDK() { return Jenkins.getInstance().getJDK(jdk); }

代码示例来源:origin: org.jenkins-ci.plugins/matrix-project

  1. /**
  2. * Gets the {@link JDK}s where the builds will be run.
  3. * @return never null but can be empty
  4. */
  5. public @Nonnull Set<JDK> getJDKs() {
  6. final Jenkins jenkins = Jenkins.getInstance();
  7. if (jenkins == null) {
  8. return Collections.emptySet();
  9. }
  10. Axis a = axes.find("jdk");
  11. if(a==null) return Collections.emptySet();
  12. Set<JDK> r = new HashSet<JDK>();
  13. for (String j : a) {
  14. JDK jdk = jenkins.getJDK(j);
  15. if(jdk!=null)
  16. r.add(jdk);
  17. }
  18. return r;
  19. }

代码示例来源:origin: org.jenkins-ci.plugins/matrix-project

  1. @Override
  2. public JDK getJDK() {
  3. final Jenkins jenkins = Jenkins.getInstance();
  4. return jenkins != null ? jenkins.getJDK(combination.get("jdk")) : null;
  5. }

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

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

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

  1. JDK jdk = Jenkins.getActiveInstance().getJDK(builder.getFitnesseJdk(envVars));
  2. if (jdk != null) {
  3. Node node = Computer.currentComputer().getNode();

相关文章

Jenkins类方法