> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/java/surefire-integration-setup.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
