maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick <kc7...@gmail.com>
Subject Can't figure out how to filter resources
Date Sun, 10 Jun 2012 01:11:09 GMT
I can't get the Maven resources plugin to filter.  Any advice?  I've looked through the documentation,
but I can't find any complete examples.  Below it what I've managed to piece together, but
it doesn't work.

./pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  
  <name>seeingi-lib</name>
  <groupId>org.seeingi</groupId>
  <artifactId>seeingi-lib</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <resources>
            <resource>
              <directory>src/main/resources</directory>
              <filtering>true</filtering>
            </resource>
          </resources>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
</project>


./src/main/resources/hello.txt:
Hello @name@
Hello ${name}


Expected at ./target/classes/hello.txt:
Hello seeingi-lib
Hello seeingi-lib


Actual at ./target/classes/hello.txt:
Hello @name@
Hello ${name}


Notes:
I've tested this on MacOS and windows.  Windows I used Netbeans, and on MacOS I used "mvn
install".  (MacPorts version Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)


Does anyone what I'm doing wrong, or a working and complete example?
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message