4

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
samdunne
  • 306
  • 1
  • 2
  • 14

1 Answers1

5

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

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32