Displaying custom test results in Jenkins Maven job

To build upon the answer by bpanulla, if you have tests in more than one sub-directory of your project, you can use a wildcard in the "Test report XMLs" field, such as: **/target/surefire-reports/*.xml


If you have a more modular Jenkins setup using a free project will not correctly build submodules. If the maven-plugin that generates the reports execution id is e2eTests, then add the following snippet to your pom.xml and the jenkins maven plugin will take care of the rest!

<properties>
    <jenkins.e2eTests.reportsDirectory>target/protractor-reports</jenkins.e2eTests.reportsDirectory>
</properties>

See https://wiki.jenkins-ci.org/display/JENKINS/Building+a+maven2+project


I worked through this problem by using a "free-style software project" in Jenkins rather than the "maven2/3" project.

New Project

Under Build, choose Add build step and configure the project to Invoke top-level Maven targets. I'm using the test target.

Invoke top-level Maven targets

Finally, under Post-build Actions choose Add post-build action of Publish JUnit test result report and point it at the xUnit output from your tests. This option is not available for Maven 2/3 jobs for some reason.

Publish JUnit test result report