Hi

I'm trying to activate resources filtering by using properties in the pom.
I've done several tests but the magic is still not happening ;)

To be absolutely sure of what is happening i've created a brand new empty
webapp with maven archetype.

My webapp tree is : 
/pom.xml
/src/... (usual index.jps and basic web.xml)
/filters/local.properties
/config/toto.txt

Here is the pom.xml :

<project xmlns="http://maven ...>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-webapp</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>

    <properties>
       
<filtering-local-file>${basedir}/filters/local.properties</filtering-local-file>
        <filtering-local-status>true</filtering-local-status>
    </properties>

    <build>
    <finalName>my-webapp</finalName>
        <filters>
                <filter>${filtering-local-file}</filter>
        </filters>
        <resources>
                <resource>
                        <directory>config</directory>
                        <filtering>${filtering-local-status}</filtering>
                </resource>
        </resources>
        <plugins>
                <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>2.4.1</version>
                        <configuration>
                                <encoding>UTF-8</encoding>
                        </configuration>
                   </plugin>
        </plugins>
    </build>
</project>

The local.properties file contains :

toto=tata

The toto.txt file contains :

${toto}


So now if I launch a mvn clean compile i get in /target/classes/toto.txt :

${toto}

:confused:

BUT if I change  <filtering>${filtering-local-status}</filtering> for
<filtering>true</filtering> in the pom.xml i get   in
/target/classes/toto.txt :

tata
:clap:

Therefore i'm pretty confused whether or not it is possible to use a
property to conditionally launch a filtering resource task.

Thanx in advance

Manu 




-- 
View this message in context: 
http://old.nabble.com/-Maven_2.1.0-maven-resources_2.4.1--filtering-tag-and-property-tp26268107p26268107.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to