You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tom Purcell <tp...@chariotsolutions.com> on 2008/05/29 19:43:14 UTC

War Plugin Filtering

Hello

I am trying to filter values in an XML document that should be placed in the
WEB-INF directory of a war. The file is located in the source structure in
src/main/webapp/WEB-INF/beans.xml along with web.xml.

I've configured the war plugin as follows:
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.0</version>
  <configuration>
    <filters>
      <filter>src/main/filters/wile.filter.properties</filter>
    </filters>
    <webResources>
      <webResource>
        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
        <includes>
          <include>beans.xml</include>
          <include>web.xml</include>
        </includes>
        <targetPath>WEB-INF</targetPath>
        <filtering>true</filtering>
      </webResource>
    </webResources>
  </configuration>
</plugin>

What happens is that the war winds up with two copies of both web.xml and
beans.xml. At the root of the war there are copies that are properly
filtered. In the war's WEB-INF are unfiltered copies.

I was using Maven 2.0.8. I upgraded to 2.0.9 and got the same result. Any
help would be appreciated.

Thanks
Tom
-- 
View this message in context: http://www.nabble.com/War-Plugin-Filtering-tp17541883p17541883.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: War Plugin Filtering

Posted by Martin <mg...@hotmail.com>.
doc is available at
http://maven.apache.org/guides/getting-started/index.html#How%20do%20I%20filter%20resource%20files?

so executing this command against the filtering goal called 
process-resources
mvn <target> -Dfilter.properties = <yourPropertyValue>  process-resources

where the parameters for filter.properties located in pom.xml setup the 
filter.properties
<properties>
 <filter.properties>yourPropertyValue</filter.properties>
</properties>
<!--- Load in Filter properties --->
<filters>
         <filter>src/main/filters/${filter.properties}</filter>
</filters>

<!-- Execute filter with set properties -->
<resources>
        <resource>
	        <filtering>true</filtering>
		<directory>src/main/resources</directory>
	</resource>
</resources>
Notice that filtering is set to true for the folder 
src/main/resourcesHTHMartin----- Original Message ----- 
From: "Tom Purcell" <tp...@chariotsolutions.com>
To: <us...@maven.apache.org>
Sent: Thursday, May 29, 2008 1:43 PM
Subject: War Plugin Filtering


>
> Hello
>
> I am trying to filter values in an XML document that should be placed in 
> the
> WEB-INF directory of a war. The file is located in the source structure in
> src/main/webapp/WEB-INF/beans.xml along with web.xml.
>
> I've configured the war plugin as follows:
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-war-plugin</artifactId>
>  <version>2.0</version>
>  <configuration>
>    <filters>
>      <filter>src/main/filters/wile.filter.properties</filter>
>    </filters>
>    <webResources>
>      <webResource>
>        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
>        <includes>
>          <include>beans.xml</include>
>          <include>web.xml</include>
>        </includes>
>        <targetPath>WEB-INF</targetPath>
>        <filtering>true</filtering>
>      </webResource>
>    </webResources>
>  </configuration>
> </plugin>
>
> What happens is that the war winds up with two copies of both web.xml and
> beans.xml. At the root of the war there are copies that are properly
> filtered. In the war's WEB-INF are unfiltered copies.
>
> I was using Maven 2.0.8. I upgraded to 2.0.9 and got the same result. Any
> help would be appreciated.
>
> Thanks
> Tom
> -- 
> View this message in context: 
> http://www.nabble.com/War-Plugin-Filtering-tp17541883p17541883.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: War Plugin Filtering

Posted by Tom Purcell <tp...@chariotsolutions.com>.
Thank you. That was it.


olamy wrote:
> 
> Upgrade the war plugin version to last one : 2.1-alpha-1
> 
> --
> Olivier
> 
> 2008/5/29 Tom Purcell <tp...@chariotsolutions.com>:
>>
>> Hello
>>
>> I am trying to filter values in an XML document that should be placed in
>> the
>> WEB-INF directory of a war. The file is located in the source structure
>> in
>> src/main/webapp/WEB-INF/beans.xml along with web.xml.
>>
>> I've configured the war plugin as follows:
>> <plugin>
>>  <groupId>org.apache.maven.plugins</groupId>
>>  <artifactId>maven-war-plugin</artifactId>
>>  <version>2.0</version>
>>  <configuration>
>>    <filters>
>>      <filter>src/main/filters/wile.filter.properties</filter>
>>    </filters>
>>    <webResources>
>>      <webResource>
>>        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
>>        <includes>
>>          <include>beans.xml</include>
>>          <include>web.xml</include>
>>        </includes>
>>        <targetPath>WEB-INF</targetPath>
>>        <filtering>true</filtering>
>>      </webResource>
>>    </webResources>
>>  </configuration>
>> </plugin>
>>
>> What happens is that the war winds up with two copies of both web.xml and
>> beans.xml. At the root of the war there are copies that are properly
>> filtered. In the war's WEB-INF are unfiltered copies.
>>
>> I was using Maven 2.0.8. I upgraded to 2.0.9 and got the same result. Any
>> help would be appreciated.
>>
>> Thanks
>> Tom
>> --
>> View this message in context:
>> http://www.nabble.com/War-Plugin-Filtering-tp17541883p17541883.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/War-Plugin-Filtering-tp17541883p17542283.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: War Plugin Filtering

Posted by Olivier Lamy <ol...@apache.org>.
Upgrade the war plugin version to last one : 2.1-alpha-1

--
Olivier

2008/5/29 Tom Purcell <tp...@chariotsolutions.com>:
>
> Hello
>
> I am trying to filter values in an XML document that should be placed in the
> WEB-INF directory of a war. The file is located in the source structure in
> src/main/webapp/WEB-INF/beans.xml along with web.xml.
>
> I've configured the war plugin as follows:
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-war-plugin</artifactId>
>  <version>2.0</version>
>  <configuration>
>    <filters>
>      <filter>src/main/filters/wile.filter.properties</filter>
>    </filters>
>    <webResources>
>      <webResource>
>        <directory>${basedir}/src/main/webapp/WEB-INF</directory>
>        <includes>
>          <include>beans.xml</include>
>          <include>web.xml</include>
>        </includes>
>        <targetPath>WEB-INF</targetPath>
>        <filtering>true</filtering>
>      </webResource>
>    </webResources>
>  </configuration>
> </plugin>
>
> What happens is that the war winds up with two copies of both web.xml and
> beans.xml. At the root of the war there are copies that are properly
> filtered. In the war's WEB-INF are unfiltered copies.
>
> I was using Maven 2.0.8. I upgraded to 2.0.9 and got the same result. Any
> help would be appreciated.
>
> Thanks
> Tom
> --
> View this message in context: http://www.nabble.com/War-Plugin-Filtering-tp17541883p17541883.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org