Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kev1n-zhao/jenkins-rest
Light-weight Jenkins REST client for Java
https://github.com/kev1n-zhao/jenkins-rest
java jenkins jenkins-rest rest
Last synced: about 1 month ago
JSON representation
Light-weight Jenkins REST client for Java
- Host: GitHub
- URL: https://github.com/kev1n-zhao/jenkins-rest
- Owner: kev1n-zhao
- Created: 2019-07-19T11:44:18.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-23T10:18:28.000Z (over 5 years ago)
- Last Synced: 2024-11-14T12:53:40.894Z (about 1 month ago)
- Topics: java, jenkins, jenkins-rest, rest
- Language: Java
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jenkins-REST
Light-weight Jenkins REST API Client for Java
**no more classpath conflicts !!**
-----
After googling for a few days I found it hard to get a jenkins rest api client for java without a dozen of dependencies, the offical client com.offbytwo.jenkins caused me lots of classpath conflicts with aws sdk, kafka java sdk etc. Most of them are around common utility libs like jackson. To fix these classpath conflicts, Instead of rewriting another aws sdk or kafka sdk which is obviously too much to complete, jenkins seems to be the easy answer. Here comes this light weight jenkins rest api client, currently it supports:
* basic http authentication with account username, password/api-token
* build job with or without parameters
* customizable jenkins log handler ( register callback method which will trigger when log entry is retrieved )
* customizable jenkins job progress handler ( register callback method which will trigger when certain job lifecycle event is reached )
* job timeout config (throw exception after timeout)
* synchronized await until job complete## Quick Start
update your build.gradle, add the following dependency:
```gradlecompile group: 'io.github.kev1nst', name: 'jenkins-rest', version: '1.0.1'
```
Then in your Java code, simplely add the following:
```java
JobResult result=Jenkins.connect(JENKINS_URL, ACCOUNT, CREDENTIAL).build("folder1/job1").await();
// then start to write whatever code you want to execute after the job is completed```
the [Demo](https://github.com/kev1nst/jenkins-client/blob/master/src/test/java/io/github/kev1nst/jenkins/Demo.java) class in the source code provides most of the common use cases of how-to