# Surefire Integration Setup

How to configure Surefire integration

## Problem <a href="#problem" id="problem"></a>

The Plugin Engine detects an invalid Surefire configuration

## Cause <a href="#cause" id="cause"></a>

### Overridden argLine <a href="#overridden-argline" id="overridden-argline"></a>

{% hint style="warning" %}
The below is handled automatically when using the automatic pom integration [scanning-builds](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-build-tools-plugins/sealights-maven-plugin/scanning-builds "mention") with build scanner 2.0.1045 and up
{% endhint %}

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 <a href="#solution" id="solution"></a>

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:

{% code overflow="wrap" lineNumbers="true" %}

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

{% endcode %}

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

{% code overflow="wrap" lineNumbers="true" %}

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

```

{% endcode %}
