Re: Change config file content using maven plugin

2004-10-21 Thread Jason van Zyl
On Wed, 2004-10-20 at 10:29, 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.

If you want simple substitution, then the solution outlined earler using
the ant copy task with filters would be just fine. If you need something
a little more powerful then you can use the velocity Jelly tag. If you
need to perform a certain stretch of logic based on the value of a
property.

 Thanks, Ian.
 
 
   
 ___
 Do you Yahoo!?
 Declare Yourself - Register online to vote today!
 http://vote.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
jvz.

Jason van Zyl
[EMAIL PROTECTED]
http://maven.apache.org

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

 -- Thoreau 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Change config file content using maven plugin

2004-10-20 Thread Ian Neruda
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Change config file content using maven plugin

2004-10-20 Thread Eric Giguere
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]