Normalize Spring properties to kebab-case
org.openrewrite.java.spring.PropertiesToKebabCaseorg.openrewrite.recipe:rewrite-springNormalize Spring properties to use lowercase and hyphen-separated syntax. For example, changing spring.main.showBanner to spring.main.show-banner. With Spring's relaxed binding, kebab-case may be used in properties files and still be converted to configuration beans. Note, an exception to this is the case of @Value, which is match-sensitive. For example, @Value("${anExampleValue}") will not match an-example-value. The Spring reference documentation recommends using `kebab-case` for properties where possible.
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.spring.PropertiesToKebabCaseIf the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-spring:6.36.0Definition
This recipe runs the following recipes in order.
- Normalize Spring
application*.{yml,yaml}properties to kebab-caseorg.openrewrite.java.spring.PropertiesToKebabCaseYaml - Normalize Spring
application*.propertiesproperties to kebab-caseorg.openrewrite.java.spring.PropertiesToKebabCaseProperties
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats