Jenkins4J
Simple and effective Jenkins API wrapper written in Java
Install / Use
/learn @Citymonstret/Jenkins4JREADME
Jenkins4J
Simple and effective non-blocking Jenkins API wrapper written in Java
What can it do?
Jenkins4J supports the following actions:
- Get all publicly (or protected, using authentication) available jobs from a Jenkins instance
- Parse job data for builds and metadata
- Parse job data for artifacts and metadata
How does it work?
Jenkins4J uses the Jenkins remote access JSON API (in the future, XML support may be added). Retrofit is used as the HTTP client, Gson is used for JSON deserialization and general Guava utilities are used throughout Jenkins4J.
How to use it?
In order to get started, create a new Jenkins instance using a JenkinsBuilder, like this:
final Jenkins jenkins = Jenkins.newBuilder().withPath("https://your.jenkins.path/").build();
If you need to authenticate against the Jenkins server, use the withBasicAuthentication method in
the Jenkins builder
Using this instance, you can fetch the master node, available jobs, specific job information and/or specific build information.
There are two types of objects that you will encounter when working with Jenkins4J:
- description
- info
A description is a simple member of an info class, and it will often just contain a name or a number.
You can use a description to get a (CompletableFuture of) an information class. Information classes
contain references to child nodes, and a bunch of meta data. This is to mirror how the Jenkins API works.
You can use description classes to retrieve their corresponding information classes, by using getParent().
All information classes can also be retrieved using the Jenkins instance.
Retrieval of objects will always be non-blocking, and return CompletableFuture's.
Examples
Examples can be found in the examples directory.
JavaDoc can be found in the docs directory.
Maven
Jenkins4J is using the JitPack maven repository.
To use it, add the following repository:
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
and the following dependency:
<dependency>
<groupId>com.github.Sauilitired</groupId>
<artifactId>Jenkins4J</artifactId>
<version>3.0-SNAPSHOT</version>
</dependency>
Jenkins
Jenkins4J is on Jenkins. The job can be found here!
Contributions & Contact
Contributions are very welcome! The project uses the Google Java code style. The project is licensed under the MIT license.
If you have any further questions or feedback, then feel free to join our Discord.
If the project helped you, then you are free to give me some coffee money via PayPal
:coffee:
Related Skills
gh-issues
349.2kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
349.2kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
349.2kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
