Describes the setup for reporting the status of jQAssistant rules as test results in Jenkins CI.

This tutorial is written for version 1.6.0 of jQAssistant.

1. jQAssistant JUnit Reports

The results of rules (i.e. constraints and concepts) executed during a jQAssistant analysis are written as JUnit test results. These can be evaluated by the Jenkins xUnit plugin and reported for each build. For Maven projects these are located in the folder target/jqassistant/report/junit. If the CLI is used the files can be found in jqassistant/report/junit.

2. Setting Up The xUnit Plugin for Jenkins

The []xUnit plugin for Jenkins allows to scan for JUnit test results and publishing them. To pickup the results written by jQAssistant execute the following steps:

  1. Make sure the xUnit plugin is installed (Manage JenkinsManage Plugins)

  2. Open the job configuration

  3. Add a build step Process xUnit test result report after the step that builds your project using Maven or the CLI and that executes the jQAssistant analysis

  4. Select the report type JUnit

  5. Specify a list of file patterns to the locations where your test reports are located, e.g. "target/jqassistant/report/junit/*.xml, target/surefire-reports/*.xml, target/failsafe-reports/*.xml" for Maven projects

  6. Save the changes.

job configuration


After running a build the jQAssistant test results are reported beside your unit tests:

test result
The described setup refers to Jenkins jobs created using the type Freestyle project. The job type Maven project currently does not allow specifying additional locations for JUnit test reports.

3. Controlling Failures And Errors

The test results are written by the jQAssistant JUnit Report plugin. It provides configuration properties which can be used to specify the behavior if a failing rule is detected:

The severity from which a failed rule will be reported as failure (default: MINOR)

The severity from which a failed rule will be reported as error (default:MAJOR)

The default severities correspond to those of concepts (MINOR) and constraints (MAJOR). These settings can be changed by specifying report properties for the jQAssistant analysis.

In case of Maven this is done by adding a reportProperties section to your pom.xml:


For execution via command line create a file with the following content:

The command line utility can now be executed with the following parameter: analyze -p

4. Resources