You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Keith Ganger (JIRA)" <ji...@codehaus.org> on 2008/04/12 22:05:58 UTC

[jira] Created: (MWAR-153) Resource filtering breaks when run from parent POM.

Resource filtering breaks when run from parent POM. 
----------------------------------------------------

                 Key: MWAR-153
                 URL: http://jira.codehaus.org/browse/MWAR-153
             Project: Maven 2.x War Plugin
          Issue Type: Bug
    Affects Versions: 2.0.2
         Environment: maven 2.08 
Windows and solaris
            Reporter: Keith Ganger
         Attachments: test.zip

<webResources><resource><directory>  breaks when run from a parent pom. 

When you define a resource directory for filtering, you must define it relative to the POM.  When run from the war project's pom eveything works.  When run from the  parent you get an error 
{quote}
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] basedir src\main\webapp\WEB-INF does not exist
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
{quote}

This is of course because the directory is relative to the child pom, where the plugin configuration was defined, not relative to the parent pom.    

I have attached an example project that demonstrates the bug. 
To repoduce 
*  Run mvn package from the child my-app project everything works.  
* run mvn pacakge from the parent directory you will get the error. 

-- 
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: (MWAR-153) Resource filtering breaks when run from parent POM.

Posted by "Jonas Fleer (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=130764#action_130764 ] 

Jonas Fleer commented on MWAR-153:
----------------------------------

Your example just runs fine here.

My env:
{noformat}
Maven version: 2.0.8
Java version: 1.5.0_13
OS name: "mac os x" version: "10.5.2" arch: "i386" Family: "unix"
{noformat}

Anyway, i had a similar problem. Try to prepend {{${basedir}}} on the path of the file that could not be found.

> Resource filtering breaks when run from parent POM. 
> ----------------------------------------------------
>
>                 Key: MWAR-153
>                 URL: http://jira.codehaus.org/browse/MWAR-153
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: maven 2.08 
> Windows and solaris
>            Reporter: Keith Ganger
>         Attachments: test.zip
>
>
> <webResources><resource><directory>  breaks when run from a parent pom. 
> When you define a resource directory for filtering, you must define it relative to the POM.  When run from the war project's pom eveything works.  When run from the  parent you get an error 
> {quote}
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] basedir src\main\webapp\WEB-INF does not exist
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> {quote}
> This is of course because the directory is relative to the child pom, where the plugin configuration was defined, not relative to the parent pom.    
> I have attached an example project that demonstrates the bug. 
> To repoduce 
> *  Run mvn package from the child my-app project everything works.  
> * run mvn pacakge from the parent directory you will get the error. 

-- 
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: (MWAR-153) Resource filtering breaks when run from parent POM.

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=130766#action_130766 ] 

Benjamin Bentmann commented on MWAR-153:
----------------------------------------

Keith, you should try out the latest release version of the plugin, which is 2.1-alpha-1. Its source seems to properly resolve relative paths against the project base directory instead of the current working directory (e.g. the base directory of the parent POM). I suspect Jonas already uses this version and hence couldn't reproduce your problem.

bq. Try to prepend ${basedir} on the path of the file that could not be found.
But please always fill in issues where this workaround is necessary because this is almost never intended.

> Resource filtering breaks when run from parent POM. 
> ----------------------------------------------------
>
>                 Key: MWAR-153
>                 URL: http://jira.codehaus.org/browse/MWAR-153
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: maven 2.08 
> Windows and solaris
>            Reporter: Keith Ganger
>         Attachments: test.zip
>
>
> <webResources><resource><directory>  breaks when run from a parent pom. 
> When you define a resource directory for filtering, you must define it relative to the POM.  When run from the war project's pom eveything works.  When run from the  parent you get an error 
> {quote}
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] basedir src\main\webapp\WEB-INF does not exist
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> {quote}
> This is of course because the directory is relative to the child pom, where the plugin configuration was defined, not relative to the parent pom.    
> I have attached an example project that demonstrates the bug. 
> To repoduce 
> *  Run mvn package from the child my-app project everything works.  
> * run mvn pacakge from the parent directory you will get the error. 

-- 
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: (MWAR-153) Resource filtering breaks when run from parent POM.

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

Dennis Lundberg closed MWAR-153.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1-alpha-1

I tried this with Maven WAR Plugin 2.0.2 and I get the same error that the reprter got.

When I used version 2.1-alpha-1 it works as expected. It also works with latest trunk.

> Resource filtering breaks when run from parent POM. 
> ----------------------------------------------------
>
>                 Key: MWAR-153
>                 URL: http://jira.codehaus.org/browse/MWAR-153
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: maven 2.08 
> Windows and solaris
>            Reporter: Keith Ganger
>             Fix For: 2.1-alpha-1
>
>         Attachments: test.zip
>
>
> <webResources><resource><directory>  breaks when run from a parent pom. 
> When you define a resource directory for filtering, you must define it relative to the POM.  When run from the war project's pom eveything works.  When run from the  parent you get an error 
> {quote}
> [ERROR] FATAL ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] basedir src\main\webapp\WEB-INF does not exist
> [INFO] ------------------------------------------------------------------------
> [DEBUG] Trace
> {quote}
> This is of course because the directory is relative to the child pom, where the plugin configuration was defined, not relative to the parent pom.    
> I have attached an example project that demonstrates the bug. 
> To repoduce 
> *  Run mvn package from the child my-app project everything works.  
> * run mvn pacakge from the parent directory you will get the error. 

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