Awesome Open Source
Awesome Open Source

Build Status codecov Download Stack Overflow


Java client is built on the top of jclouds for working with Jenkins REST API.


Client's can be built like so:

JenkinsClient client = JenkinsClient.builder()
.endPoint("") // Optional. Defaults to
.credentials("admin:password") // Optional.

SystemInfo systemInfo = client.api().systemApi().systemInfo();

Latest release

Can be found in jcenter like so:

  <classifier>sources|tests|javadoc|all</classifier> (Optional)


Property based setup

Client instances do NOT need to supply the endPoint or credentials as a part of instantiating the JenkinsClient object. Instead one can supply them through system properties, environment variables, or a combination of the two. System properties will be searched first and if not found, will attempt to query the environment.

Setting the endpoint can be done with any of the following (searched in order):

  • jenkinsRestEndpoint

Setting the credentials can be done with any of the following (searched in order):

  • jenkinsRestCredentials


jenkins-rest credentials can take 1 of 2 forms:

  • Colon delimited username and password: admin:password
  • Base64 encoded username and password: YWRtaW46cGFzc3dvcmQ=


The mock and live tests provide many examples that you can use in your own code.


  • jclouds - used as the backend for communicating with Jenkins REST API
  • AutoValue - used to create immutable value types both to and from the jenkins program


Running mock tests can be done like so:

./gradlew clean build mockTest

Running integration tests can be done like so (requires existing jenkins instance):

./gradlew clean build integTest 

Integration tests settings

Jenkins instance requirements

This project provides instructions to setup a pre-configured Docker container

Integration tests configuration

  • jenkins url and authentication method used by the tests are defined in the file
  • by default, tests use the credentials authentication but this can be changed to use the token authentication

Running integration tests from within your IDE

  • the integTest gradle tasks set various System Properties
  • if you don't want to use gradle as tests runner in your IDE, configure the tests with the same kind of System Properties

Additional Resources

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (31,534
devops (583
rest-api (559
rest (498
client (399
ci (241
continuous-integration (192
jenkins (177
cd (62