> 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/maven/update-parent-pom-file.md).

# Update Parent POM File

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

When a maven project contains one or multiple parent POM files which update the `argLine` of the Surefire or the Failsafe plugin, you will need to update the parent POM file as well as the project POM.

### Solution: <a href="#solution" id="solution"></a>

2 flags need to be added to the `-pom` command:

1. `modifyParentPom true` - Enable the feature
2. `mavenLocalRepoPath /path/to/m2/repository` - Provide the path of the .m2 folder’s repository

There are 3 different scenarios:

1. If the project POM file has a relativePath in the \<parent> section - it will update this file
2. If no relativePath, it will search for a pom.xml file in the parent folder and update this file
3. If no pom.xml file in the parent folder, it will search for it in the .m2 repository folder (under the `../repository/<groupId>/<artifactId>/<version>/<artifactId>-<versionId>.pom`)

### Example: <a href="#example" id="example"></a>

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

```
java -jar sl-build-scanner.jar -pom -configfile slmaven.json -workspacepath . -mavenLocalRepoPath /Users/Tests/.m2/repository -modifyParentPom true
```

{% 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/maven/update-parent-pom-file.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.
