use of hudson.model.JDK in project hudson-2.x by hudson.
the class MatrixProject method getJDKs.
/**
* Gets the {@link JDK}s where the builds will be run.
* @return never null but can be empty
*/
public Set<JDK> getJDKs() {
Axis a = getAxes().find("jdk");
if (a == null)
return Collections.emptySet();
Set<JDK> r = new HashSet<JDK>();
for (String j : a) {
JDK jdk = Hudson.getInstance().getJDK(j);
if (jdk != null)
r.add(jdk);
}
return r;
}
use of hudson.model.JDK in project sonar-scanner-jenkins by SonarSource.
the class SonarRunnerBuilder method computeJdkToUse.
private void computeJdkToUse(Run<?, ?> build, FilePath workspace, TaskListener listener, EnvVars env) throws IOException, InterruptedException {
JDK jdkToUse = getJdkToUse(getProject(build));
if (jdkToUse != null) {
Computer computer = workspace.toComputer();
// just in case we are not in a build
if (computer != null) {
jdkToUse = jdkToUse.forNode(computer.getNode(), listener);
}
jdkToUse.buildEnvVars(env);
}
}
use of hudson.model.JDK in project configuration-as-code-plugin by jenkinsci.
the class JdkConfiguratorTest method configure_jdk_tool.
@Test
public void configure_jdk_tool() {
final JDK.DescriptorImpl descriptor = ExtensionList.lookupSingleton(JDK.DescriptorImpl.class);
assertEquals(1, descriptor.getInstallations().length);
JDK jdk = descriptor.getInstallations()[0];
assertEquals("jdk11", jdk.getName());
assertEquals("/jdk", jdk.getHome());
InstallSourceProperty installSourceProperty = jdk.getProperties().get(InstallSourceProperty.class);
assertEquals(1, installSourceProperty.installers.size());
AdoptOpenJDKInstaller installer = installSourceProperty.installers.get(AdoptOpenJDKInstaller.class);
assertEquals("jdk-11.0.14+9", installer.id);
}
Aggregations