Dear,
I'm trying to write a groovy script which manages the JDK installs.
The code below would set the JDK installation with the home folder. Although I would like to us an automatic installation from Oracle.
You have to set the username and password for this. But how do i pass the username and password to the Descriptor of JDKInstaller?
If I look at
http://javadoc.jenkins-ci.org/hudson/tools/JDKInstaller.DescriptorImpl.html I can see that you can getUsername an getPassword.
A guess would be it's done by passing it through JSON in the configure method???
Could anyone provide a code example?
JDKDesc = Jenkins.instance.getDescriptorByName("hudson.model.JDK");
JDK jdk = new JDK("JDK 8", "/usr/lib/jvm/java-8-openjdk-amd64");
jdkDesc.setInstallations(jdk);
jdks = jdkDesc.getInstallations();
jdkDesc.save();
Jenkins.instance.save()
thanks!
Stijn