> 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 dynamically by asking a question.

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

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/troubleshooting-faq/maven/update-parent-pom-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
