Skip to content

ChangeSpringPropertyKey

pl.allegro.tech.allwrite.recipes.spring.ChangeSpringPropertyKey

Renames a Spring property key across YAML, .properties, and other files (e.g. Markdown). For YAML and .properties, delegates to OpenRewrite's ChangeSpringPropertyKey. For other files, performs a regex find-and-replace supporting both lower-hyphen and lowerCamel case formats.

Options:

Name Type Required Description
oldKey String Yes The property key to rename. Supports glob.
newKey String Yes The new name for the property key.

Before (with oldKey = "i18n.language-bundle.enabled", newKey = "myapp.i18n.language-bundle.enabled"):

i18n:
  language-bundle:
    enabled: true

After:

myapp.i18n.language-bundle.enabled: true