Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.37 KB

README.md

File metadata and controls

31 lines (25 loc) · 1.37 KB

Maven failure handler junit extension

Description of problem

When running JUnit test it can happen that the test is not run because of some previous maven phase failure (eg. dependency cannot be downloaded, compilation error, etc..). We could use some tool (eg. Jenkins JUnit plugin) to visualize test results, where we don't have to rely on reading the log. In that case we wouldn't see the failure on the first look and we could potentionally overlook it.

What the extension does

It will catch failure occurred during any maven phase which was executed before test (surefire/failsafe) phase. From those failures are then constructed artificial XML surefire report files and placed under <module>/target/surefire-reports.

Build and use

Firstly build the extension.

mvn clean install

Then use it in your test run.

-Dmaven.ext.class.path=<jar-file>

Or placing XML into ${maven.multiModuleProjectDirectory}/.mvn/extensions.xml:

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
  <extension>
    <groupId>org.jboss.qa</groupId>
    <artifactId>maven-failure-handler-junit</artifactId>
    <version>1.1.0</version>
  </extension>
</extensions>

Articles and other sources