Change JDK settings for all projects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Change JDK settings for all projects

Matthias Waller-2
Hi,

is it possible to change the used JDK for all projects?
I tried this with the Groovy script console but I'm at a loss.

My script:

import hudson.model.*

def h = Hudson.getInstance()
def p = h.getProjects()

for (n in p)
{
   // do something to set JDK x ???
}

Thanks,
--
Matthias Waller

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Change JDK settings for all projects

Kohsuke Kawaguchi-2
Good question. We don't have a setter for JDK. I just added one, so that
you can do:

Matthias Waller wrote:
> def h = Hudson.getInstance()
> def p = h.getProjects()
>
> for (n in p)
> {
      n.setJDK(h.getJDK("myNewJDK"));
> }

I guess we are missing a lot of setters like this in many places.

You can also do this by modifying the config XML files.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment