You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "alien.sulin" <su...@gmail.com> on 2009/12/19 19:09:54 UTC

can pom file be filtered?

dear all:
I have a problem about how to configure war plugin, the details are below.

A file(contain the password and username) as a resource in our project, it
should be
stored in different places with different machine; So i configure the pom as
below, but
maven can't get the varaible!

The pom.xml file
<build>
<filters>
<filter>src/main/webconfig/config.properties</filter>
</filters>
<finalName>monitor</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-1</version>
<configuration>
<webResources>
<resource>
<directory>${file.dir}</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>

and the config.properties file in my windows would be like this:
file.dir = D:/file

but the config.properties file in the server would be like file.dir =
/home/user/test/config

but when i run the mvn package, it should copy the file under the D:/file or
  /home/user/test/config
to the WEB-INF

but, the maven tell me the webresource directory is null . maven has not got
the varaible ${file.dir}

how can i make the webresource become a configurable?

Ant suggestion are appreciated!

alien.sulin(苏琳冲)
SuLinchong
Qq        387973308
Msn      sulinchong@hotmail.com