[
http://jira.codehaus.org/browse/MRESOURCES-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249428#action_249428
]
Alexandre Bénard commented on MRESOURCES-104:
---------------------------------------------
I confirm the bug on 3.0.1 and 3.0.2-SNAPSHOT (from today) but not on 2.2.1.
I notice 2 things.
First, filtering depend on the number of @ before the ${testProperty}:
- odd the ${testProperty} is not processed,
- even the ${testProperty} is processed.
Secondly, if you add one @ after the ${testProperty}, the all the file is
correctly processed.
So, a workaround could be to add a @ in a comment at the end of the file.
The first example modify like this works:
This property ${project.version} was replaced
but the one behind a @ will not be processed, as you
see: ${project.version}. You shouldn't see a property reference.
But if there is a second @, all the file is correctly processed !!!
> while filtering resources the token replacement stops at the character @
> -------------------------------------------------------------------------
>
> Key: MRESOURCES-104
> URL: http://jira.codehaus.org/browse/MRESOURCES-104
> Project: Maven 2.x Resources Plugin
> Issue Type: Bug
> Affects Versions: 2.4
> Environment: Windows XP, Java 1.6.0_16
> Reporter: Thomas Fahrmeyer
> Assignee: Arnaud Heritier
> Priority: Critical
> Fix For: 2.5
>
> Attachments: m3-resource-filtering.zip, MRESOURCES-104.zip
>
>
> Create a simple file hello.txt under src/main/resources with following
> content:
> "
> This property ${testProperty} was replaced
> but the one behind a @ will not be processed, as you
> see: ${testProperty}. You shouldn't see a property reference.
> "
> define a build section in your pom.xml like this
> <build>
> <resources>
> <resource>
> <directory>src/main/resources</directory>
> <filtering>true</filtering>
> <includes>
> <include>**/*.txt</include>
> </includes>
> </resource>
> <resource>
> <directory>src/main/resources</directory>
> <filtering>false</filtering>
> <excludes>
> <exclude>**/*.txt</exclude>
> </excludes>
> </resource>
> </resources>
> Run the command:
> mvn process-resources -DtestProperty=IwasReplaced
> this produces the output
> "
> This property IwasReplaced was replaced
> but the one behind a @ will not be processed, as you
> see: ${testProperty}. You shouldn't see a property reference.
> "
> As you see, the second property reference was not resolved. The replacement
> just stops after the @ character.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira