jdkDesc = Jenkins.instance.getDescriptorByName("hudson.model.JDK");
JDK jdk6 = new JDK("JDK6", "/usr/lib/jvm/java-6-openjdk-amd64");
JDK jdk7 = new JDK("JDK7", "/usr/lib/jvm/java-7-openjdk-amd64");
jdkDesc.setInstallations(jdk6, jdk7); // this overrides any already
existing jdk
jdks = jdkDesc.getInstallations();
for (jdk in jdks) {
println("JDK name: " + jdk.getName() + ", home: " + jdk.getHome());
}
jdkDesc.save();
This Groovy script doesn't save the newly added JDK installations to the
config file, so after a restart they are gone. I use the same method on
other plugins/config and there it works.
Am I doing something wrong?
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.