Add Maven parent

Apache 2.0

Add a parent pom to a Maven pom.xml. Does nothing if a parent pom is already present.

org.openrewrite.maven.AddParentPom

Required

The group ID of the maven parent pom to be adopted.

The artifact ID of the maven parent pom to be adopted.

An exact version number or node-style semver selector used to select the version number.

New relative path attribute for parent lookup.

Optional

Allows version selection to be extended beyond the original Node Semver semantics. So for example,Setting 'version' to "25-29" can be paired with a metadata pattern of "-jre" to select Guava 29.0-jre

mod run . --recipe=org.openrewrite.maven.AddParentPom \ -P groupId=org.springframework.boot \ -P artifactId=spring-boot-starter-parent \ -P version=29.X \ -P relativePath=../pom.xml

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.