By default maven will filter resources like this:
<properties>
<replace.me>value</replace.me>
</properties>
<some-tag>
<key>${replace.me}</key>
</some-tag>
will get you:
<some-tag>
<key>value</key>
</some-tag>
Is there a way to override the way maven selects the strings to replace? Specifically, I want to be able to use this:
<some-tag>
<key>@replace.me@</key>
</some-tag>
to get the same result as above.
Have a look at the delimiters
parameter of the resources mojo. Configuring the plugin like this will do the trick:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<delimiters>
<delimiter>${*}</delimiter><!-- to keep the default behavior -->
<delimiter>@</delimiter><!-- to add Ant-like tokens style -->
</delimiters>
</configuration>
</plugin>
If you would like to use only one approach then disable default delimeters:
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With