maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erlend Hamnaberg <ngar...@gmail.com>
Subject Re: Modules in phase order
Date Tue, 02 Feb 2010 14:43:10 GMT
This really sounds like something for maven filtering.
put your file somewhere in src/main/resources

then let the file contain for instance

(xml file)

<foo version="$version">
  <bar/>
</foo>

add the following to your pom

      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <includes>
              <include>**/foo.xml</include>
            </includes>
          </resource>
          <resource>
            <directory>src/main/resources</directory>
            <filtering>false</filtering>
            <excludes>
              <exclude>**/foo.xml</exclude>
            </excludes>
          </resource>
        </resources>
      </build>


Now maven will look for all string which matches $something (basically
anything that is accessable as a maven property) and filter your file
correctly.
This means that the modified file will be copied, and the file in the source
folder will be left alone..


Is it something like this you need?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message