You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ian Springer (JIRA)" <ji...@codehaus.org> on 2007/06/13 15:29:59 UTC

[jira] Commented: (MRESOURCES-29) An escape mechanism for property interpolation is missing.

    [ http://jira.codehaus.org/browse/MRESOURCES-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_99314 ] 

Ian Springer commented on MRESOURCES-29:
----------------------------------------

An way to escape $'s should certainly be provided.

But further, as the original poster suggested, there should be a way to configure what the token format is. Here is a use case for providing this:

I am using the resources plugin to copy over a bunch of JBoss config files. If you've used JBoss, you know that it supports runtime replacement of ${foo} tokens with system properties. So, in most cases, I don't want Maven messing with the ${foo} tokens in these files. However, there are a handful of tokens I do want Maven to replace. If I could change the token format to something other than the ${foo} default, then I could use that alternate format for the tokens I do want Maven to replace.

Here's an example of how this might be specified in the POM:

<resources>
    
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <tokenStartDelimiter>@@</tokenStartDelimiter>
        <tokenEndDelimiter>@@</tokenEndDelimiter>
      </resource>

...

</resources>

This would tell the resources plugin to replace tokens of the form @@foo@@ instead of the default form ${foo}.

If others could benefit from this feature, say so. If there's enough interest, I'll whip up a patch.


> An escape mechanism for property interpolation is missing.
> ----------------------------------------------------------
>
>                 Key: MRESOURCES-29
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-29
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.3
>            Reporter: Hendrik Schreiber
>
> It would be great, if there was a mechanism that let's you escape a property so that it is not replaced by the filtering machism. E.g. in a log4j.xml configuration file you might want to preserve ${user.home}, but replace some other property like ${log.dir}. Currently there is no convenient way to achieve that.
> Alternatively to escaping, it would be helpful, if one could choose the token format. So, if one could say, only honor @token@ and not ${token} (or the other way around) one could easily work around the escape problem.
> Workaround for the problem mentioned above:
> replace the ${user.home} in log4j.xml with @start@user.home@end@ and define     start=${    and end=$}   in the property file

-- 
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