Configure Jenkins JDK installations Programmatically

438 views Asked by At

I'm looking to configure Jenkins JDK installations programmatically, either through the CLI or by writing XML files.

I know I can amend the config.xml file (main one) to include JDK installations but I'd prefer to have it configured in a separate file. (e.g hudson.tasks.Ant.xml)

How to achieve this?

1

There are 1 answers

0
Marcin Grzejszczak On BEST ANSWER

I've managed to do it :) Just call this: jenkins.model.Jenkins.getInstance().getJDKs().add(new hudson.model.JDK("id", "path"))