Java API for Jenkins

Santhosh picture Santhosh · Nov 3, 2014 · Viewed 7.1k times · Source

I am writing a Java application where I need to track the status of Jenkins build and execute few actions on build success and failure.

I am quite new to Jenkins. Is there a Java api available to track the status of the build?

Is it possible to trigger the java application on successful completion or during the failure of the build.

Your suggestions are welcome.

Thanks, Santhosh

Answer

KeepCalmAndCarryOn picture KeepCalmAndCarryOn · Nov 3, 2014

There is the Jenkins REST API which could suit your needs

Alternatively, there are literally hundreds of plugins for Jenkins so it is likely that you could run your whole process from within Jenkins using

Build Pipeline

This plugin provides a Build Pipeline View of upstream and downstream connected jobs that typically form a build pipeline. In addition, it offers the ability to define manual triggers for jobs that require intervention prior to execution, e.g. an approval process outside of Jenkins.

Multijob

Gives the option to define complex and hierarchical jobs structure in Jenkins.