1

I want to install jenkins plugin programmatically using java. can any one help me on this?

Not a bug
  • 4,286
  • 2
  • 40
  • 80

1 Answers1

3

You can access Jenkins remotely using the remote api . This can be used to install plugins as well, look at this gist and for example:

curl -X POST -d '<jenkins><install plugin="git@2.0" /></jenkins>' --header 'Content-Type: text/xml' http://localhost:8080/pluginManager/installNecessaryPlugins

will install the git plugin. So by using some HTTP library in Java you can do this from Java as well, posting HTTP requests to the remote api and installing plugins.

Peter Svensson
  • 6,105
  • 1
  • 31
  • 31
  • Using remote api,i dint find any way like how to give the line " in java . Any one please help me –  Jan 31 '14 at 09:53
  • Something like this? http://stackoverflow.com/questions/4205980/java-sending-http-parameters-via-post-method-easily – Peter Svensson Feb 02 '14 at 06:31