# 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](/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/java-build-tools-plugins/sealights-maven-plugin/scanning-builds.md) 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/java/surefire-integration-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
