You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ra...@jpmchase.com on 2006/06/09 21:05:18 UTC
modifiying xml files??
Hi All
Is that possible to filter and modify the xml file using any plugin???
Like i have the following code snippet in my ant build.xml, which i will
run from command line as "ant -Denv=sit <target_name>"
1. copy my.xml as data.xml into /tmp dir
2. then using filter token, i will replace the value of
"retryConnectionFactory" with the properties i defined in build.xml
<copy file="my.xml"
tofile="tmp/data.xml"
overwrite="true">
<filterset>
<filter token="retryConnectionFactory"
value="${${env}_retryConnectionFactory}"/>
<filter token="retryQueueDestination"
value="${{${env}_retryQueueDestination}"/>
</filterset>
</copy>
is there a way to do it in maven using any plugin??
users@maven.apache.orgi dont want to use the same ant code in maven2
Please advise
Thanks,
Raghu
Re: modifiying xml files??
Posted by Wayne Fay <wa...@gmail.com>.
You can replace tokens using filters in Maven2. It will replace
${your-token-here} in your source files with properties defined in
your pom or profile.
This is covered in detail in the Maven book mentioned numerous times
on this mailing list. Review section 2.6.2 "Filtering Classpath
Resources".
Wayne
On 6/9/06, raghurajan.x.gurunathan@jpmchase.com
<ra...@jpmchase.com> wrote:
> Hi All
>
> Is that possible to filter and modify the xml file using any plugin???
>
>
> Like i have the following code snippet in my ant build.xml, which i will
> run from command line as "ant -Denv=sit <target_name>"
> 1. copy my.xml as data.xml into /tmp dir
> 2. then using filter token, i will replace the value of
> "retryConnectionFactory" with the properties i defined in build.xml
>
> <copy file="my.xml"
> tofile="tmp/data.xml"
> overwrite="true">
> <filterset>
> <filter token="retryConnectionFactory"
> value="${${env}_retryConnectionFactory}"/>
> <filter token="retryQueueDestination"
> value="${{${env}_retryQueueDestination}"/>
> </filterset>
> </copy>
>
> is there a way to do it in maven using any plugin??
> users@maven.apache.orgi dont want to use the same ant code in maven2
>
> Please advise
>
> Thanks,
> Raghu
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org