You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matt Steele (JIRA)" <ji...@codehaus.org> on 2008/07/30 22:24:26 UTC

[jira] Created: (MRESOURCES-70) Filter does not process nested ${} variables

Filter does not process nested ${} variables
--------------------------------------------

                 Key: MRESOURCES-70
                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
             Project: Maven 2.x Resources Plugin
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: Matt Steele


When I try filtering this under src/main/resources:
jms.username=${${env}.jms.username}

with this filtering strategy:
  	<resources>
  		<resource>
  			<directory>src/main/resources</directory>
  			<filtering>true</filtering>
  		</resource>
  	</resources>

Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
jms.username=${${env}.jms.username} 

For example, I'd like the filter to convert to this (using a property of -Denv=dev):
jms.username=${dev.jms.username} 

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

        

[jira] Updated: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated MRESOURCES-70:
----------------------------------------

    Issue Type: New Feature  (was: Bug)

> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] Updated: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier updated MRESOURCES-70:
--------------------------------------

    Attachment: MRESOURCES-70.zip

IT for MRESOURCES-70

> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: 2.5
>
>         Attachments: MRESOURCES-70.zip
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] Commented: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Antony Bourgois (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196551#action_196551 ] 

Antony Bourgois commented on MRESOURCES-70:
-------------------------------------------

I'm having the same issue with Maven 2.2.1 - though the nesting works fine in Maven 2.0.7.

In my project's POM, I have the 2 properties:

        <deploy-env>local</deploy-env>
        <db.user>${db.user.${deploy-env}}</db.user>

In the above config, "deploy-env" is defaulted to "local", which I override at the command prompt with -Ddeploy-env=test

In my ~/.m2/settings.xml, I have the following properties:

        <!-- local connection -->
        <db.user.local>defaultAdmin</db.user.local>
        <!-- test connection -->
        <db.user.test>remoteAdmin</db.user.test>

I just have to modify the M2_HOME env variable to switch Maven version and experience the difference in evaluated output.

In my filtered config, ${db.user} evaluates to:
- in 2.0.7 - databaseUser=defaultAdmin   (correct)
- in 2.2.1 - databaseUser=${db.user.${deploy-env}}   (oops! unexpected)

Is this an actual bug or a feature change between 2.0.x and 2.2.x?

It's actually quite an issue for us as you expect.
If you have a comment, that'd be great.

> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: 2.5
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] Issue Comment Edited: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Antony Bourgois (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196551#action_196551 ] 

Antony Bourgois edited comment on MRESOURCES-70 at 10/29/09 11:39 AM:
----------------------------------------------------------------------

I'm having the same issue with Maven 2.2.1 - though the nesting works fine in Maven 2.0.7.
[ btw I'm using maven-resources-plugin-2.4.1 and I haven't traced the issue to this plugin ]

In my project's POM, I have the 2 properties:

        <deploy-env>local</deploy-env>
        <db.user>${db.user.${deploy-env}}</db.user>

In the above config, "deploy-env" is defaulted to "local", which I override at the command prompt with -Ddeploy-env=test

In my ~/.m2/settings.xml, I have the following properties:

        <!-- local connection -->
        <db.user.local>defaultAdmin</db.user.local>
        <!-- test connection -->
        <db.user.test>remoteAdmin</db.user.test>

I just have to modify the M2_HOME env variable to switch Maven version and experience the difference in evaluated output.

In my filtered config, ${db.user} evaluates to:
- in 2.0.7 - databaseUser=defaultAdmin   (correct)
- in 2.2.1 - databaseUser=${db.user.${deploy-env}}   (oops! unexpected)

Is this an actual bug or a feature change between 2.0.x and 2.2.x?

It's actually quite an issue for us as you expect.
If you have a comment, that'd be great.

      was (Author: daexus):
    I'm having the same issue with Maven 2.2.1 - though the nesting works fine in Maven 2.0.7.

In my project's POM, I have the 2 properties:

        <deploy-env>local</deploy-env>
        <db.user>${db.user.${deploy-env}}</db.user>

In the above config, "deploy-env" is defaulted to "local", which I override at the command prompt with -Ddeploy-env=test

In my ~/.m2/settings.xml, I have the following properties:

        <!-- local connection -->
        <db.user.local>defaultAdmin</db.user.local>
        <!-- test connection -->
        <db.user.test>remoteAdmin</db.user.test>

I just have to modify the M2_HOME env variable to switch Maven version and experience the difference in evaluated output.

In my filtered config, ${db.user} evaluates to:
- in 2.0.7 - databaseUser=defaultAdmin   (correct)
- in 2.2.1 - databaseUser=${db.user.${deploy-env}}   (oops! unexpected)

Is this an actual bug or a feature change between 2.0.x and 2.2.x?

It's actually quite an issue for us as you expect.
If you have a comment, that'd be great.
  
> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: 2.5
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] Issue Comment Edited: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=192591#action_192591 ] 

John Casey edited comment on MRESOURCES-70 at 9/28/09 11:23 AM:
----------------------------------------------------------------

I'm guessing MRESOURCES-104 hits the same snag as MRESOURCES-70, with the difference being that -104 is handling a nested expression involving two different sets of delimiters, both of which are enabled by default: ${\*} and @\*@. In the InterpolationFilterReader, it will not replace the contents of an expression for which the ending delimiter is never specified, as this isn't technically a valid expression.

So, it seems that if we solve the recursive expression problem, we can solve both of these issues.

      was (Author: jdcasey):
    I'm guessing MRESOURCES-104 hits the same snag as MRESOURCES-70, with the difference being that -104 is handling a nested expression involving two different sets of delimiters, both of which are enabled by default: ${*} and @*@. In the InterpolationFilterReader, it will not replace the contents of an expression for which the ending delimiter is never specified, as this isn't technically a valid expression.

So, it seems that if we solve the recursive expression problem, we can solve both of these issues.
  
> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Olivier Lamy (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olivier Lamy updated MRESOURCES-70:
-----------------------------------

    Fix Version/s:     (was: 2.6)
                   backlog
    
> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>          Components: delimiters
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: backlog
>
>         Attachments: MRESOURCES-70.zip
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MRESOURCES-70:
--------------------------------------

    Fix Version/s:     (was: 2.5)
                   2.6

> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>          Components: delimiters
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: 2.6
>
>         Attachments: MRESOURCES-70.zip
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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

        

[jira] Updated: (MRESOURCES-70) Filter does not process nested ${} variables

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRESOURCES-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MRESOURCES-70:
--------------------------------------

    Component/s: delimiters

> Filter does not process nested ${} variables
> --------------------------------------------
>
>                 Key: MRESOURCES-70
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-70
>             Project: Maven 2.x Resources Plugin
>          Issue Type: New Feature
>          Components: delimiters
>    Affects Versions: 2.2
>            Reporter: Matt Steele
>             Fix For: 2.5
>
>         Attachments: MRESOURCES-70.zip
>
>
> When I try filtering this under src/main/resources:
> jms.username=${${env}.jms.username}
> with this filtering strategy:
>   	<resources>
>   		<resource>
>   			<directory>src/main/resources</directory>
>   			<filtering>true</filtering>
>   		</resource>
>   	</resources>
> Setting the property (from command line, <property>, etc.) fails to properly filter the nested element:
> jms.username=${${env}.jms.username} 
> For example, I'd like the filter to convert to this (using a property of -Denv=dev):
> jms.username=${dev.jms.username} 

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