Support escaping property placeholders with backslash#6817
Merged
Conversation
When recipe YAML contains Maven property references like ${java.version}
in parameter values, the YamlResourceLoader resolves them as property
placeholders at load time. This prevents users from passing literal
${...} references through to recipe parameters.
Add escape support: doubling the first character of the placeholder
prefix (e.g., writing $${java.version} for the ${ prefix) produces
a literal ${java.version} in the resolved output.
Fixes moderneinc/customer-requests#1874
When recipe YAML contains Maven property references like ${java.version}
in parameter values, the YamlResourceLoader resolves them as property
placeholders at load time. This prevents users from passing literal
${...} references through to recipe parameters.
Add escape support: a backslash before the placeholder prefix (e.g.,
writing \${java.version} for the ${ prefix) produces a literal
${java.version} in the resolved output.
Fixes moderneinc/customer-requests#1874
Document the \${...} escape syntax in the ChangePluginConfiguration
@option description so users know how to pass literal Maven property
references.
Add regression tests to ensure existing behavior is preserved:
- Unresolved placeholders are left as-is
- Normal resolution still works
- Backslashes not before a placeholder prefix are preserved
timtebeek
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PropertyPlaceholderHelper: writing\${...}in recipe YAML preserves the literal${...}in the output instead of resolving it as a placeholderChangePluginConfiguration.configuration@Optiondescription to document the escape syntax${java.version}inChangePluginConfigurationwere resolved at recipe load time instead of being preserved literallyTest plan
PropertyPlaceholderHelperTest: 6 new tests covering escaped placeholders, mixed escaped/resolved, regression for unresolved left as-is, normal resolution, and backslash preservationChangePluginConfigurationTest: 2 new tests for Maven property references via direct construction and YAML loading with escape syntax./gradlew build -x javadocpasses (361 tasks, 0 failures)