rewrite-spring-core
The rewrite-spring-core module publishes 6 recipes across 1 category.
spring › boot › properties
Recipes
Add a comment to a Spring Boot configuration property
io.arconia.rewrite.spring.boot.properties.CommentSpringBootProperty
Add a comment to a property in Spring Boot configuration files. Optionally, comment out the property itself.
| Name | Type | Required | Description |
|---|---|---|---|
|
String |
yes |
The key for the property to comment. |
|
String |
yes |
The comment to add before the property key. |
|
Boolean |
no |
Whether to comment out the property. Defaults to |
Example
arconia:
feature:
toggle: true
tier: platinum
arconia:
feature:
# This property has been removed from this version
# toggle: true
tier: platinum
Change the value of a Spring Boot configuration property key
io.arconia.rewrite.spring.boot.properties.ChangeSpringBootPropertyValue
Change the value of a property in Spring Boot configuration files.
| Name | Type | Required | Description |
|---|---|---|---|
|
String |
yes |
The property key whose value must change. |
|
String |
no |
The property value to change. |
|
String |
yes |
The new value for the property key. |
|
Boolean |
no |
Treats the old property value as a regular expression for matching.
When enabled, only matching portions are replaced, and capture groups
can be referenced in the new value. Defaults to |
|
Boolean |
no |
Whether to match the property key using Spring Boot relaxed binding rules. Defaults to |
|
List |
no |
Glob expressions to match Spring Boot configuration files to modify.
Defaults to standard |
Example
arconia:
feature:
toggle: true
arconia:
feature:
toggle: enabled
Delete a Spring Boot configuration property
io.arconia.rewrite.spring.boot.properties.DeleteSpringBootProperty
Delete a property in Spring Boot configuration files.
| Name | Type | Required | Description |
|---|---|---|---|
|
String |
yes |
The key of the property to delete. |
|
Boolean |
no |
Whether to match the property key using Spring Boot relaxed binding rules. Defaults to |
|
List |
no |
Glob expressions to match Spring Boot configuration files to modify.
Defaults to standard |
Example
arconia:
modes:
name: fantasy
Find Spring Boot configuration files
io.arconia.rewrite.spring.boot.properties.FindSpringBootConfigFiles
Finds Spring Boot configuration files based on the provided path matchers.
| Name | Type | Required | Description |
|---|---|---|---|
|
List |
no |
A list of glob expressions used to match which files contain Spring Boot configuration properties and therefore will be modified. If no value is provided, default expressions will be used to match the main YAML and Properties files supported by Spring Boot for configuration. If multiple patterns are supplied, any of the patterns matching will be interpreted as a match. |
Example
spring.application.name=myapp
~~>spring.application.name=myapp
Rename Spring Boot configuration property key
io.arconia.rewrite.spring.boot.properties.RenameSpringBootPropertyKey
Rename the key of a property in Spring Boot configuration files.
| Name | Type | Required | Description |
|---|---|---|---|
|
String |
yes |
The property key to rename. |
|
String |
yes |
The new name for the property key. |
|
Boolean |
no |
Whether to match the old property key using Spring Boot relaxed binding rules. Defaults to |
|
List |
no |
Glob expressions to match Spring Boot configuration files to modify.
Defaults to standard |
Example
arconia:
dev:
profiles:
test: local
arconia:
config.profiles.test: local
Rename a Spring Boot configuration property key if its value matches
io.arconia.rewrite.spring.boot.properties.RenameSpringBootPropertyKeyIfValue
Rename the key of a property in Spring Boot configuration files when its current value matches the given value.
| Name | Type | Required | Description |
|---|---|---|---|
|
String |
yes |
The property key to rename. |
|
String |
yes |
The property value that must be present for the key to be renamed. |
|
String |
yes |
The new name for the property key. |
|
Boolean |
no |
Whether to match the old property key using Spring Boot relaxed binding rules. Defaults to |
|
List |
no |
Glob expressions to match Spring Boot configuration files to modify.
Defaults to standard |
Example
arconia:
feature:
mode: advanced
arconia:
feature:
advanced-mode: advanced