maven-users mailing list archives

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

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" 
                <ant:filter token="log4j:log4j" 
                <ant:filter token="commons-logging:commons-logging" 

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

Hope it helps

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!
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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