maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Giguere <eric.gigu...@videotron.ca>
Subject Re: Change config file content using maven plugin
Date Wed, 20 Oct 2004 16:41:19 GMT
Hi

The Ant copy tag can be used with its built in filtering mechanism. You 
put in tokens that get replaced by values you specify in tag itself.
When this is done in a maven.xml file, you can vitually replace these 
tokens with anything, including artifact ids, complete jar names version 
included you can get out of the project dependencies and etc.

Here is an example.
        <ant:copy todir="${dist.assembly.dir}" flatten="true" 
filtering="true" >
            <ant:filterset id="content.filter">
                <ant:filter token="batchfile-artifact" 
value="${maven.final.name}.jar"/>
                <ant:filter token="log4j:log4j" 
value="${pom.getDependency('log4j:log4j').artifact}"/>
                <ant:filter token="commons-logging:commons-logging" 
value="${pom.getDependency('commons-logging:commons-logging').artifact}"/>
            </ant:filterset>
       </ant:copy>

By defaut, tokens in the files must be enclosed in @ characters (ex. 
@batchfile-artifact@ that will get replaced by the maven.final.name value)

Hope it helps
Eric.

Ian Neruda wrote:

>I need to change config file parameters depending on
>targeted environment(test or production). 
>Is there a plugin that could do something like this?
>
>Files I need to change are web.xml and my custom xml
>config file.
>
>Thanks, Ian.
>
>
>		
>_______________________________
>Do you Yahoo!?
>Declare Yourself - Register online to vote today!
>http://vote.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>  
>


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