All Projects → jenkins-zh → jenkins-client-java

jenkins-zh / jenkins-client-java

Licence: MIT license
Java实现的对Jenkins操作

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to jenkins-client-java

black-postoffice
[무신사 신입] 익명으로 편하게 고민, 일상을 공유하는 소셜 네트워크 서비스입니다.
Stars: ✭ 31 (+10.71%)
Mutual labels:  jenkins
Hands-On-Serverless-Applications-with-Go
Hands-On Serverless Applications with Go, published by Packt.
Stars: ✭ 92 (+228.57%)
Mutual labels:  jenkins
matrix-auth-plugin
Matrix-based authorization strategies for Jenkins
Stars: ✭ 40 (+42.86%)
Mutual labels:  jenkins
cjp-demo-environment
CloudBees CI Demo based on Docker Compose
Stars: ✭ 23 (-17.86%)
Mutual labels:  jenkins
Containerization-Automation
Study and Use of Containers and Automation Tools
Stars: ✭ 45 (+60.71%)
Mutual labels:  jenkins
learn-ansible-and-jenkins-in-30-days
Ansible + Jenkins in 30 days tutorial.
Stars: ✭ 35 (+25%)
Mutual labels:  jenkins
Real Time Social Media Mining
DevOps pipeline for Real Time Social/Web Mining
Stars: ✭ 22 (-21.43%)
Mutual labels:  jenkins
one-click-microservice
A starting point for automating the creation of microservices and all its Ops costs with a single click.
Stars: ✭ 27 (-3.57%)
Mutual labels:  jenkins
SeleniumTDD
A Selenium TDD framework that incorporates key features of Selenium and TestNG which can be used to create web-based automation scripts.
Stars: ✭ 23 (-17.86%)
Mutual labels:  jenkins
caesar
持续集成
Stars: ✭ 40 (+42.86%)
Mutual labels:  jenkins
jira-trigger-plugin
Triggers a build when a certain condition is matched in JIRA
Stars: ✭ 112 (+300%)
Mutual labels:  jenkins
up
UP - Ultimate Provisioner CLI
Stars: ✭ 43 (+53.57%)
Mutual labels:  jenkins
config-file-provider-plugin
Jenkins plugin to administrate the maven settings (settings.xml).
Stars: ✭ 43 (+53.57%)
Mutual labels:  jenkins
intelirest-cli
A cli interpreter for intelliJ .http files
Stars: ✭ 23 (-17.86%)
Mutual labels:  jenkins
windows-slave-installer-module
Windows Agent Installer module for Jenkins
Stars: ✭ 12 (-57.14%)
Mutual labels:  jenkins
cloud-s4-sdk-pipeline
The Cloud SDK pipeline uses the Cloud SDK continuous delivery server for building, checking, and deploying extension applications. Projects based on the SAP Cloud SDK archetype will automatically use this pipeline.
Stars: ✭ 65 (+132.14%)
Mutual labels:  jenkins
devops-jenkins-box-template
Bootstrap template to provision your agency own Jenkins server
Stars: ✭ 22 (-21.43%)
Mutual labels:  jenkins
vacomall
☀️☀️ 基于 dubbo 实现的分布式电商平台。
Stars: ✭ 42 (+50%)
Mutual labels:  jenkins
drone-jenkins
Drone plugin for trigger Jenkins jobs.
Stars: ✭ 35 (+25%)
Mutual labels:  jenkins
jenkins-stack-docker
Docker-compose version of jenkins-stack-kubernetes
Stars: ✭ 135 (+382.14%)
Mutual labels:  jenkins

Maven Central

jenkins-client-java

Java binding for the Jenkins client.

sonar

How to use it

Add the following dependency to the pom.xml file of your project:

<dependency>
    <groupId>com.surenpi.ci</groupId>
    <artifactId>jenkins.client.java</artifactId>
    <version>1.0.0-20171217</version>
</dependency>

Example of get all jobs from jenkins

import com.surenpi.jenkins.client.Jenkins;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;

/**
 * @author suren
 */
public class Demo
{
    public static void main(String[] args) throws URISyntaxException, IOException
    {
        URI serverURI = new URI("http://localhost:8080/jenkins");
        Jenkins jenkins = new Jenkins(serverURI, "admin", "admin");

        Jobs jobMgr = jenkins.getJobs();
        List<Job> allJobs = jobMgr.getAllJobs();

        for(Job job : allJobs)
        {
            System.out.println(job.getName());
        }
    }
}

Example of get all installed plugins from jenkins

import com.surenpi.jenkins.client.Jenkins;
import com.surenpi.jenkins.client.plugin.Plugin;
import com.surenpi.jenkins.client.plugin.Plugins;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;

/**
 * @author suren
 */
public class Demo
{
    public static void main(String[] args) throws URISyntaxException, IOException
    {
        URI serverURI = new URI("http://localhost:8080/jenkins");
        Jenkins jenkins = new Jenkins(serverURI, "admin", "admin");

        Plugins pluginMgr = jenkins.getPlugins();
        List<Plugin> allInstalledPlugins = pluginMgr.getPluginManager().getPlugins();
        for(Plugin plugin : allInstalledPlugins)
        {
            System.out.println(plugin.getShortName());
        }
    }
}

Example of get all credentials from jenkins

import com.surenpi.jenkins.client.Jenkins;
import com.surenpi.jenkins.client.credential.Credential;
import com.surenpi.jenkins.client.credential.Credentials;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Map;

/**
 * @author suren
 */
public class Demo
{
    public static void main(String[] args) throws URISyntaxException, IOException
    {
        URI serverURI = new URI("http://localhost:8080/jenkins");
        Jenkins jenkins = new Jenkins(serverURI, "admin", "admin");

        Credentials credentialMgr = jenkins.getCredentials();
        Map<String, Credential> credentialMap = credentialMgr.list();
        for(String key : credentialMap.keySet())
        {
            System.out.println(credentialMap.get(key).getDescription());
        }
    }
}

Compile & Package

If you want to compile project, you can via mvn clean compile

If you want to package project and skip the junit test, you can via mvn clean package -DskipTest

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].