/
Java - How to configure Surefire integration

Java - How to configure Surefire integration

Problem

The Plugin Engine detects an invalid Surefire configuration

Cause

Overridden argLine

The below is handled automatically when using the automatic pom integration (Scanning Builds and Tests using SeaLights Maven plugin - Automatic configuration) with build scanner 2.0.1045 and up

By default, the SeaLights Maven plugin sets the argLine used by Surefire to include the SealIghts test listener as a javaagent. If the Surefire argLine is overridden, then the SeaLights argLine will not be used and hence test information will not be captured.

Solution

For this, the SeaLights Maven plugin also generates a property called sealightsArgLine, which can be placed in the Surefire argLine for easy configuration.
Note: Using of @{sealightsArgLine} demands minimum surefire-plugin version 2.17

Here is a sample configuration for Surefire with the updated argLine at line 8:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${surefire-plugin.version}</version> <configuration> <argLine>-Xms512m -Xmx1024m @{sealightsArgLine}</argLine> </configuration> ...

You can set an empty property called sealightsArgLine so that the build will not fail when the SeaLights maven plugin doesn't run

<properties> ... <sealightsArgLine></sealightsArgLine> </properties>





Related content

Running integration tests using FailSafe
Running integration tests using FailSafe
More like this
Scanning Builds using the SeaLights Maven plugin
Scanning Builds using the SeaLights Maven plugin
Read with this
Surefire integration
Surefire integration
More like this
Running Tests (Only) using Sealights Maven plugin
Running Tests (Only) using Sealights Maven plugin
Read with this
Maven build tool - Sealights plugin
Maven build tool - Sealights plugin
More like this
Sealights Maven plugin - Command reference
Sealights Maven plugin - Command reference
More like this