You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "William Ferguson (JIRA)" <ji...@codehaus.org> on 2007/08/23 03:47:47 UTC

[jira] Created: (MRESOURCES-47) POM properties cannot be accessed within a filter file

POM properties cannot be accessed within a filter file
------------------------------------------------------

                 Key: MRESOURCES-47
                 URL: http://jira.codehaus.org/browse/MRESOURCES-47
             Project: Maven 2.x Resources Plugin
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: William Ferguson
             Fix For: 2.3
         Attachments: project.zip

Before applying a filter, the maven-resources-plugin evaluates
  1) POM structural elements such as ${project.version}
  2) System properties such as ${my.system.property}
that are referred to within *filter* files.

However, it does *not* evaluate any POM (or profile) property such as ${my.pom.property} at the same time.

Consequently it is not possible to define filter tokens that use POM properties.
Without this patch we would either need to have many more POM properties or would have lots of fine grained and typically non-intuitive tokens distributed amongst our resources.

IMHO this patch will bring the resolution mechanism for filter files in line with property resolution mechanism in general.

I have attached a zipped project containing :
  SomeResource.txt
  my.filter
Look at SomeResource.txt after being processed with filtering. Note the unresolved tokens for ${projectProperty} and ${profileProperty} for the "filter resolution" cases. Ie the POM property values of the filter tokens were never evaluated.

-- 
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-47) POM properties cannot be accessed within a filter file

Posted by "William Ferguson (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRESOURCES-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_110137 ] 

William Ferguson commented on MRESOURCES-47:
--------------------------------------------

Thanks Mauro, 2.3-20071013.152223-3 is good.

> POM properties cannot be accessed within a filter file
> ------------------------------------------------------
>
>                 Key: MRESOURCES-47
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-47
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: William Ferguson
>            Assignee: Mauro Talevi
>             Fix For: 2.3
>
>         Attachments: MRESOURCES-47-maven-resources-plugin.patch, project.zip
>
>
> Before applying a filter, the maven-resources-plugin evaluates
>   1) POM structural elements such as ${project.version}
>   2) System properties such as ${my.system.property}
> that are referred to within *filter* files.
> However, it does *not* evaluate any POM (or profile) property such as ${my.pom.property} at the same time.
> Consequently it is not possible to define filter tokens that use POM properties.
> Without this patch we would either need to have many more POM properties or would have lots of fine grained and typically non-intuitive tokens distributed amongst our resources.
> IMHO this patch will bring the resolution mechanism for filter files in line with property resolution mechanism in general.
> I have attached a zipped project containing :
>   SomeResource.txt
>   my.filter
> Look at SomeResource.txt after being processed with filtering. Note the unresolved tokens for ${projectProperty} and ${profileProperty} for the "filter resolution" cases. Ie the POM property values of the filter tokens were never evaluated.

-- 
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-47) POM properties cannot be accessed within a filter file

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

William Ferguson updated MRESOURCES-47:
---------------------------------------

    Attachment: MRESOURCES-47-maven-resources-plugin.patch

Here's the patch for this issue, including several test cases.
NB I have changed as little as possible to make the patch as clear as possible.
IMO applying the patch would then allow for substantial refactoring.

> POM properties cannot be accessed within a filter file
> ------------------------------------------------------
>
>                 Key: MRESOURCES-47
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-47
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: William Ferguson
>             Fix For: 2.3
>
>         Attachments: MRESOURCES-47-maven-resources-plugin.patch, project.zip
>
>
> Before applying a filter, the maven-resources-plugin evaluates
>   1) POM structural elements such as ${project.version}
>   2) System properties such as ${my.system.property}
> that are referred to within *filter* files.
> However, it does *not* evaluate any POM (or profile) property such as ${my.pom.property} at the same time.
> Consequently it is not possible to define filter tokens that use POM properties.
> Without this patch we would either need to have many more POM properties or would have lots of fine grained and typically non-intuitive tokens distributed amongst our resources.
> IMHO this patch will bring the resolution mechanism for filter files in line with property resolution mechanism in general.
> I have attached a zipped project containing :
>   SomeResource.txt
>   my.filter
> Look at SomeResource.txt after being processed with filtering. Note the unresolved tokens for ${projectProperty} and ${profileProperty} for the "filter resolution" cases. Ie the POM property values of the filter tokens were never evaluated.

-- 
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] Closed: (MRESOURCES-47) POM properties cannot be accessed within a filter file

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

Mauro Talevi closed MRESOURCES-47.
----------------------------------

    Resolution: Fixed

William, applied patch and added IT test. 

I've made all static methods public in PropertyUtils but refactored one to use the other as you proposed. 

There may be an argument for refactoring property access as a whole, but that should be treated as a separate issue (refactor rather than enhancement), so I'm closing this issue. 

Snapshot has been deployed to http://people.apache.org/repo/m2-snapshot-repository for test.



> POM properties cannot be accessed within a filter file
> ------------------------------------------------------
>
>                 Key: MRESOURCES-47
>                 URL: http://jira.codehaus.org/browse/MRESOURCES-47
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: William Ferguson
>            Assignee: Mauro Talevi
>             Fix For: 2.3
>
>         Attachments: MRESOURCES-47-maven-resources-plugin.patch, project.zip
>
>
> Before applying a filter, the maven-resources-plugin evaluates
>   1) POM structural elements such as ${project.version}
>   2) System properties such as ${my.system.property}
> that are referred to within *filter* files.
> However, it does *not* evaluate any POM (or profile) property such as ${my.pom.property} at the same time.
> Consequently it is not possible to define filter tokens that use POM properties.
> Without this patch we would either need to have many more POM properties or would have lots of fine grained and typically non-intuitive tokens distributed amongst our resources.
> IMHO this patch will bring the resolution mechanism for filter files in line with property resolution mechanism in general.
> I have attached a zipped project containing :
>   SomeResource.txt
>   my.filter
> Look at SomeResource.txt after being processed with filtering. Note the unresolved tokens for ${projectProperty} and ${profileProperty} for the "filter resolution" cases. Ie the POM property values of the filter tokens were never evaluated.

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