Remove redundant properties

Apache 2.0

Remove properties when a parent POM specifies the same property. When the project is built with Maven 3.10 or later, according to its BuildTool marker, the super POM's defaults count as well: project.build.sourceEncoding and project.reporting.outputEncoding set to UTF-8, and project.build.outputTimestamp set to 1980-02-01T00:00:00Z are removed when no parent POM sets them.

org.openrewrite.maven.RemoveRedundantProperties

Optional

Property name glob expression pattern used to match properties that should be checked.

onlyIfValuesMatchBoolean

Deprecated; use onlyIfParentValueIs instead. Only remove the property if its value exactly matches the property value in the parent pom. Default false.

Only remove the property if the value it would inherit from the parent POM has the specified comparative relationship to its own value. For example, gte only removes properties pinned to a version that is the same as or older than the parent's. Ordering comparisons only apply when both values are versions; other values only match when they are equal. Default any.

mod run . --recipe=org.openrewrite.maven.RemoveRedundantProperties

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