{"id":15045890,"url":"https://github.com/jenkins-zh/jenkins-client-java","last_synced_at":"2026-01-03T17:11:39.989Z","repository":{"id":27593569,"uuid":"111630036","full_name":"jenkins-zh/jenkins-client-java","owner":"jenkins-zh","description":"Java实现的对Jenkins操作","archived":false,"fork":false,"pushed_at":"2022-11-16T09:24:58.000Z","size":167,"stargazers_count":30,"open_issues_count":18,"forks_count":20,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T13:22:24.533Z","etag":null,"topics":["client","java","jenkins"],"latest_commit_sha":null,"homepage":"https://jenkins-zh.cn","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkins-zh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-22T03:08:53.000Z","updated_at":"2024-03-31T14:20:14.000Z","dependencies_parsed_at":"2023-01-14T07:05:24.747Z","dependency_job_id":null,"html_url":"https://github.com/jenkins-zh/jenkins-client-java","commit_stats":null,"previous_names":["suren-jenkins/jenkins-client-java"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkins-zh%2Fjenkins-client-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkins-zh%2Fjenkins-client-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkins-zh%2Fjenkins-client-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkins-zh%2Fjenkins-client-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkins-zh","download_url":"https://codeload.github.com/jenkins-zh/jenkins-client-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246109608,"owners_count":20724904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","java","jenkins"],"created_at":"2024-09-24T20:52:25.110Z","updated_at":"2026-01-03T17:11:39.944Z","avatar_url":"https://github.com/jenkins-zh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.surenpi/jenkins.client.java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.surenpi/jenkins.client.java)\n\n# jenkins-client-java\n\nJava binding for the Jenkins client.\n\n[sonar](https://sonarcloud.io/dashboard?id=com.surenpi.ci%3Ajenkins.client.java)\n\n# How to use it\n\nAdd the following dependency to the pom.xml file of your project:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.surenpi.ci\u003c/groupId\u003e\n    \u003cartifactId\u003ejenkins.client.java\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0-20171217\u003c/version\u003e\n\u003c/dependency\u003e\n```\n# Example of get all jobs from jenkins\n\n```java\nimport com.surenpi.jenkins.client.Jenkins;\n\nimport java.io.IOException;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.List;\n\n/**\n * @author suren\n */\npublic class Demo\n{\n    public static void main(String[] args) throws URISyntaxException, IOException\n    {\n        URI serverURI = new URI(\"http://localhost:8080/jenkins\");\n        Jenkins jenkins = new Jenkins(serverURI, \"admin\", \"admin\");\n\n        Jobs jobMgr = jenkins.getJobs();\n        List\u003cJob\u003e allJobs = jobMgr.getAllJobs();\n\n        for(Job job : allJobs)\n        {\n            System.out.println(job.getName());\n        }\n    }\n}\n```\n\n# Example of get all installed plugins from jenkins\n\n```java\nimport com.surenpi.jenkins.client.Jenkins;\nimport com.surenpi.jenkins.client.plugin.Plugin;\nimport com.surenpi.jenkins.client.plugin.Plugins;\n\nimport java.io.IOException;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.List;\n\n/**\n * @author suren\n */\npublic class Demo\n{\n    public static void main(String[] args) throws URISyntaxException, IOException\n    {\n        URI serverURI = new URI(\"http://localhost:8080/jenkins\");\n        Jenkins jenkins = new Jenkins(serverURI, \"admin\", \"admin\");\n\n        Plugins pluginMgr = jenkins.getPlugins();\n        List\u003cPlugin\u003e allInstalledPlugins = pluginMgr.getPluginManager().getPlugins();\n        for(Plugin plugin : allInstalledPlugins)\n        {\n            System.out.println(plugin.getShortName());\n        }\n    }\n}\n```\n\n# Example of get all credentials from jenkins\n\n```java\nimport com.surenpi.jenkins.client.Jenkins;\nimport com.surenpi.jenkins.client.credential.Credential;\nimport com.surenpi.jenkins.client.credential.Credentials;\n\nimport java.io.IOException;\nimport java.net.URI;\nimport java.net.URISyntaxException;\nimport java.util.Map;\n\n/**\n * @author suren\n */\npublic class Demo\n{\n    public static void main(String[] args) throws URISyntaxException, IOException\n    {\n        URI serverURI = new URI(\"http://localhost:8080/jenkins\");\n        Jenkins jenkins = new Jenkins(serverURI, \"admin\", \"admin\");\n\n        Credentials credentialMgr = jenkins.getCredentials();\n        Map\u003cString, Credential\u003e credentialMap = credentialMgr.list();\n        for(String key : credentialMap.keySet())\n        {\n            System.out.println(credentialMap.get(key).getDescription());\n        }\n    }\n}\n```\n\n# Compile \u0026 Package\n\nIf you want to compile project, you can via `mvn clean compile`\n\nIf you want to package project and skip the junit test, you can via `mvn clean package -DskipTest`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkins-zh%2Fjenkins-client-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkins-zh%2Fjenkins-client-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkins-zh%2Fjenkins-client-java/lists"}