Change Extra Property

Apache 2.0

Gradle's ExtraPropertiesExtension is a commonly used mechanism for setting arbitrary key/value pairs on a project. This recipe will change the value of a property with the given key name if that key can be found. It assumes that the value being set is a String literal. Does not add the value if it does not already exist.

org.openrewrite.gradle.ChangeExtraProperty

Required

The key of the property to change.

The new value to set. The value will be treated the contents of a string literal.

mod run . --recipe=org.openrewrite.gradle.ChangeExtraProperty \ -P key=foo \ -P value=bar

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