ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kothari, Shivani" <skoth...@inteqnet.com>
Subject How to replace context.xml in to already deployed war+application?
Date Thu, 02 Oct 2008 13:12:00 GMT
Hi,
I want to replace context.xml in already deployed application .war file
and in application folder in webapps. How can this be achieved in ant.
I have written below code - but this currpting my existing deployed
application.


<unwar src="application.war" dest="${dirs.working}/temp"/>
        <delete file="var/lib/tomcat55/webapps/application.war"/>
        <delete dir="var/lib/tomcat55/webapps/application"/>
        <copy
file="var/lib/tomcat55/webapps/application/META-INF/context.xml"
todir="${dirs.working}/temp/META-INF/"/>

        
       <!-- Creating the Configured application web archive for
Deployment-->
      <war destfile=var/lib/tomcat55/webapps/application.war"
webxml="${dirs.working}/temp/WEB-INF/web.xml" update="yes">
           <fileset dir="${dirs.working}/temp"/>
      </war>		


If anybody can help on this..

Thanks in advance!!

-----Original Message-----
From: Andy Stevens [mailto:insomniacpenguin@googlemail.com] 
Sent: Thursday, October 02, 2008 3:06 PM
To: Ant Users List
Subject: Re: How to replace tokens in to war file?

2008/10/2 Kothari, Shivani <skothari@inteqnet.com>:
> Hi,
> I want to replace tokens inside a war file. How to do that? I am able
to
> replace tokens in to exploded war folder, but I want to replace tokens
> in context.xml inside a war.

Simplest approach I can think of is
Extract file to temporary directory; replace tokens; update war with
modified file.
You could expand the whole war file and repackage it, but since it's
possible to update individual files in a zip/jar/etc. I'd just do
that.


Andy.
-- 
http://pseudoq.sourceforge.net/  Open source java Sudoku application

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message