ReplaceText transform allows replacing one or several text tokens in files as they are being copied to their destination. The replacement values are the result of dynamic evaluation of SpEL expressions.
Since this transform is text oriented, it needs to know how to interpret the stream of bytes that make up the file contents into text. By default, all files are assumed to use
UTF-8 encoding, but the UseEncoding transform can be used upfront to specify a different charset to use on (some) files.
type: ReplaceText substitutions: - text: <string> with: <SpEL expression> - text: <string> <with>: <SpEL expression> - .. condition: <SpEL expression>
Replacing the hardcoded string
"hello-world-app" with the value of variable
#artifactId in all
include: ['**/*.md', '**/*.xml', '**/*.yaml'] chain: - type: ReplaceText substitutions: - text: "hello-world-app" with: "#artifactId"
Doing the same in the
README-de.md files, which are encoded using the
include: ['README-fr.md', 'README-de.md'] chain: - type: UseEncoding encoding: 'ISO-8859-1' - type: ReplaceText substitutions: - text: "hello-world-app" with: "#artifactId"