You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Julian Wood (JIRA)" <ji...@codehaus.org> on 2006/05/18 20:00:40 UTC

[jira] Created: (MWAR-41) War plugin doesn't honour system or project properties when filtering resource files.

War plugin doesn't honour system or project properties when filtering resource files.
-------------------------------------------------------------------------------------

         Key: MWAR-41
         URL: http://jira.codehaus.org/browse/MWAR-41
     Project: Maven 2.x War Plugin
        Type: Bug

    Versions: 2.0.1    
 Environment: osx 10.4.6, java 1.4.2_06
    Reporter: Julian Wood
 Attachments: my-webapp.zip

The war plugin only honours properties specified in a properties file, identified in a build/filters/filter element.

To be consistent with regular resource filtering, it should honour properties specified on the CL, in a profile, in a plugin, or in the pom (eg., ${project.version} ). None of these currently work.

To demonstrate:

mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp

And then add this to the pom.xml:

    <build>
        <plugins>
                  <plugin>
        <artifactId>maven-war-plugin</artifactId>
          <configuration>
              <webResources>
                  <resource>
                      <filtering>true</filtering>
                      <directory>${basedir}/src/main/webapp</directory>
                      <includes>
                          <include>**/*.xml</include>
                      </includes>
                  </resource>
              </webResources>
          </configuration>
      </plugin>
        </plugins>
    </build>

And finally change the web.xml produced by the archetype so there is something to filter:

<web-app>
  <display-name>${project.name}</display-name>
</web-app>

Now 'mvn package' and note that target/my-webapp-1.0-SNAPSHOT/WEB-INF/web.xml is *not* filtered.

If you add:

            <filters>
                <filter>src/main/filters/build.dev.properties</filter>
            </filters>

to the build element, and add the build.dev.properties, and specify the project.name property, you do get successful filtering.

-- 
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-41) War plugin doesn't honour system or project properties when filtering resource files.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-41?page=all ]
     
Brett Porter closed MWAR-41:
----------------------------

    Resolution: Fixed

> War plugin doesn't honour system or project properties when filtering resource files.
> -------------------------------------------------------------------------------------
>
>          Key: MWAR-41
>          URL: http://jira.codehaus.org/browse/MWAR-41
>      Project: Maven 2.x War Plugin
>         Type: Bug

>     Versions: 2.0.1
>  Environment: osx 10.4.6, java 1.4.2_06
>     Reporter: Julian Wood
>     Assignee: Brett Porter
>      Fix For: 2.0.1
>  Attachments: my-webapp.zip
>
> Original Estimate: 30 minutes
>        Time Spent: 45 minutes
>         Remaining: 0 minutes
>
> The war plugin only honours properties specified in a properties file, identified in a build/filters/filter element.
> To be consistent with regular resource filtering, it should honour properties specified on the CL, in a profile, in a plugin, or in the pom (eg., ${project.version} ). None of these currently work.
> To demonstrate:
> mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp
> And then add this to the pom.xml:
>     <build>
>         <plugins>
>                   <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>           <configuration>
>               <webResources>
>                   <resource>
>                       <filtering>true</filtering>
>                       <directory>${basedir}/src/main/webapp</directory>
>                       <includes>
>                           <include>**/*.xml</include>
>                       </includes>
>                   </resource>
>               </webResources>
>           </configuration>
>       </plugin>
>         </plugins>
>     </build>
> And finally change the web.xml produced by the archetype so there is something to filter:
> <web-app>
>   <display-name>${project.name}</display-name>
> </web-app>
> Now 'mvn package' and note that target/my-webapp-1.0-SNAPSHOT/WEB-INF/web.xml is *not* filtered.
> If you add:
>             <filters>
>                 <filter>src/main/filters/build.dev.properties</filter>
>             </filters>
> to the build element, and add the build.dev.properties, and specify the project.name property, you do get successful filtering.

-- 
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: (MWAR-41) War plugin doesn't honour system or project properties when filtering resource files.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-41?page=all ]

Brett Porter updated MWAR-41:
-----------------------------

    Fix Version: 2.0.1

> War plugin doesn't honour system or project properties when filtering resource files.
> -------------------------------------------------------------------------------------
>
>          Key: MWAR-41
>          URL: http://jira.codehaus.org/browse/MWAR-41
>      Project: Maven 2.x War Plugin
>         Type: Bug

>     Versions: 2.0.1
>  Environment: osx 10.4.6, java 1.4.2_06
>     Reporter: Julian Wood
>      Fix For: 2.0.1
>  Attachments: my-webapp.zip
>
>
> The war plugin only honours properties specified in a properties file, identified in a build/filters/filter element.
> To be consistent with regular resource filtering, it should honour properties specified on the CL, in a profile, in a plugin, or in the pom (eg., ${project.version} ). None of these currently work.
> To demonstrate:
> mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp
> And then add this to the pom.xml:
>     <build>
>         <plugins>
>                   <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>           <configuration>
>               <webResources>
>                   <resource>
>                       <filtering>true</filtering>
>                       <directory>${basedir}/src/main/webapp</directory>
>                       <includes>
>                           <include>**/*.xml</include>
>                       </includes>
>                   </resource>
>               </webResources>
>           </configuration>
>       </plugin>
>         </plugins>
>     </build>
> And finally change the web.xml produced by the archetype so there is something to filter:
> <web-app>
>   <display-name>${project.name}</display-name>
> </web-app>
> Now 'mvn package' and note that target/my-webapp-1.0-SNAPSHOT/WEB-INF/web.xml is *not* filtered.
> If you add:
>             <filters>
>                 <filter>src/main/filters/build.dev.properties</filter>
>             </filters>
> to the build element, and add the build.dev.properties, and specify the project.name property, you do get successful filtering.

-- 
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-41) War plugin doesn't honour system or project properties when filtering resource files.

Posted by "Andrew Kasper (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_115450 ] 

Andrew Kasper commented on MWAR-41:
-----------------------------------

Incidentally, running 'mvn package' (without a 'clean') immediately after running it a first time seems to perform the token replacement.

Wild guess: the token replacements are only being performed on existing target resources.  The first time, the resource doesn't exist at the time of token replacement.  The second time, the resource exists and the plugin "correctly" replaces the tokens.

> War plugin doesn't honour system or project properties when filtering resource files.
> -------------------------------------------------------------------------------------
>
>                 Key: MWAR-41
>                 URL: http://jira.codehaus.org/browse/MWAR-41
>             Project: Maven 2.x War Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0.1
>         Environment: osx 10.4.6, java 1.4.2_06
>            Reporter: Julian Wood
>            Assignee: Brett Porter
>             Fix For: 2.0.1
>
>         Attachments: my-webapp.zip
>
>   Original Estimate: 30 minutes
>          Time Spent: 45 minutes
>  Remaining Estimate: 0 minutes
>
> The war plugin only honours properties specified in a properties file, identified in a build/filters/filter element.
> To be consistent with regular resource filtering, it should honour properties specified on the CL, in a profile, in a plugin, or in the pom (eg., ${project.version} ). None of these currently work.
> To demonstrate:
> mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp
> And then add this to the pom.xml:
>     <build>
>         <plugins>
>                   <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>           <configuration>
>               <webResources>
>                   <resource>
>                       <filtering>true</filtering>
>                       <directory>${basedir}/src/main/webapp</directory>
>                       <includes>
>                           <include>**/*.xml</include>
>                       </includes>
>                   </resource>
>               </webResources>
>           </configuration>
>       </plugin>
>         </plugins>
>     </build>
> And finally change the web.xml produced by the archetype so there is something to filter:
> <web-app>
>   <display-name>${project.name}</display-name>
> </web-app>
> Now 'mvn package' and note that target/my-webapp-1.0-SNAPSHOT/WEB-INF/web.xml is *not* filtered.
> If you add:
>             <filters>
>                 <filter>src/main/filters/build.dev.properties</filter>
>             </filters>
> to the build element, and add the build.dev.properties, and specify the project.name property, you do get successful filtering.

-- 
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: (MWAR-41) War plugin doesn't honour system or project properties when filtering resource files.

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-41?page=all ]

Brett Porter updated MWAR-41:
-----------------------------

             Assign To: Brett Porter
    Remaining Estimate: 30 minutes
     Original Estimate: 30 minutes

> War plugin doesn't honour system or project properties when filtering resource files.
> -------------------------------------------------------------------------------------
>
>          Key: MWAR-41
>          URL: http://jira.codehaus.org/browse/MWAR-41
>      Project: Maven 2.x War Plugin
>         Type: Bug

>     Versions: 2.0.1
>  Environment: osx 10.4.6, java 1.4.2_06
>     Reporter: Julian Wood
>     Assignee: Brett Porter
>      Fix For: 2.0.1
>  Attachments: my-webapp.zip
>
> Original Estimate: 30 minutes
>         Remaining: 30 minutes
>
> The war plugin only honours properties specified in a properties file, identified in a build/filters/filter element.
> To be consistent with regular resource filtering, it should honour properties specified on the CL, in a profile, in a plugin, or in the pom (eg., ${project.version} ). None of these currently work.
> To demonstrate:
> mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.0-alpha-4 -DgroupId=ca.ucalgary.tlc -DartifactId=my-webapp
> And then add this to the pom.xml:
>     <build>
>         <plugins>
>                   <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>           <configuration>
>               <webResources>
>                   <resource>
>                       <filtering>true</filtering>
>                       <directory>${basedir}/src/main/webapp</directory>
>                       <includes>
>                           <include>**/*.xml</include>
>                       </includes>
>                   </resource>
>               </webResources>
>           </configuration>
>       </plugin>
>         </plugins>
>     </build>
> And finally change the web.xml produced by the archetype so there is something to filter:
> <web-app>
>   <display-name>${project.name}</display-name>
> </web-app>
> Now 'mvn package' and note that target/my-webapp-1.0-SNAPSHOT/WEB-INF/web.xml is *not* filtered.
> If you add:
>             <filters>
>                 <filter>src/main/filters/build.dev.properties</filter>
>             </filters>
> to the build element, and add the build.dev.properties, and specify the project.name property, you do get successful filtering.

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