Anupama Boorlagadda
Anupama Boorlagadda

Reputation: 1288

Is there any Jenkins API to retrieve PMD/ findbugs, checkstyle results

I have a requirement to retrieve Findbugs, PMD and checkstyle reports using API.

FindBugs: bug report can be extracted from findbug.xml
Is there any other option other than extracting report from xml files?

Update: Answer

As @Andrew said, You can find findbugs result json by appending /api/json to jenkins results:

http://<jenkins-host:port>/job/<your_job_name>/<build_id>/7/findbugsResult/api/json?depth=2

http://<jenkins-host:port>/job/<your_job_name>/<build_id>/7/pmdResult/api/json?depth=2

http://<jenkins-host:port>/job/<your_job_name>/<build_id>/7/checkstyleResult/api/json?depth=2

If you want only numbers use /api/json?depth=0

Upvotes: 1

Views: 619

Answers (1)

Andrew Gray
Andrew Gray

Reputation: 3671

Jenkins REST API exposes the information on many of the key pages as json by adding the suffix /api/json.

The relevant plugins that publish these type of results to the dashboard are the Warnings and Static Code Analysis plugins, both written by Ulli Hafner

The Warnings Plugin (since release 4.49) seem to support retrieving result information via the Jenkins Restful interface. Have a read of the conversation here.

Upvotes: 2

Related Questions