Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Java wrapper for the Jenkins web service API

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 checkstyle-btc.xml
Octocat-spinner-32 codeformat.xml
Octocat-spinner-32 pom.xml

Java wrapper for the Jenkins web service API


Create a Guice injector with the JenkinsWsClientGuiceModule and retrieve an instance of JenkinsClient.

Injector injector = Guice.createInjector(new JenkinsWsClientGuiceModule("http://my.jenkins.endpoint/jenkins"));
JenkinsClient client = injector.getInstance(JenkinsClient.class);

New jobs can be created with JenkinsClient.createJob(...). Existing jobs can be retrieved with JenkinsClient.retrieveJob(...), and deleted with JenkinsClient.deleteJob(...).

// Prepare list of users that has access to the job.
List<User> users = new ArrayList<>();
users.add(new UserImpl("John Doe", "");

Job newJob = client.createJob("MyFirstJob", "git://my.git.repo/myfirstproject.git", users);

Job existingJob = client.retrieveJob("SomeOtherJob");


Make sure to release all acquired resources with the JenkinsClient.close() method afterwards:


The JenkinsClient class is AutoCloseable, so it can be used in a try-with-resources pattern.


To run the integrationtest, copy the src/test/resources/*.example to files without the .example suffix, and edit them to point the integration tests to your own Jenkins server.

Make sure that these files do not end with a newline!

Something went wrong with that request. Please try again.