I think this makes lots of sense. Let me ask you how to change context file
property values. My context file looks like
<Context path="/doceng" reloadable="true" docBase="${docBase}">
<Resource name="jdbc/docengdb" auth="Container"
type="javax.sql.DataSource"
driverClassName="${driverclassName}"
url="${dburl}"
username="${dbusername}"
password="${dbpassword}"
maxActive="${maxactive}"
maxIdle="${maxidle}"
maxWait="${maxwait}"/>
</Context>
All the parameters are defined in build.properties but deploy task does not
change the values, which results bad deployment.
The ant deploy task is
<target name="deploy.app.context" description="Deploys the application to
this host's servers">
<deploy
url="${remote.tomcat.manager.url}"
username="${remote.tomcat.manager.username}"
password="${remote.tomcat.manager.password}"
path="/test"
config="file:///${doceng.home}/tomcat/test.xml"/>
</target>
--- On Mon, 5/4/09, Mark Coffin <[email protected]> wrote:
> From: Mark Coffin <[email protected]>
> Subject: RE: [Xmltask-users] Conditional insert based on xpath
> To: "Lukacs, Gabriel" <[email protected]>, "Cool The Breezer"
> <[email protected]>, [email protected]
> Date: Monday, May 4, 2009, 10:40 AM
> I wouldn't recommend putting your
> application specific stuff in the
> server.xml file for Tomcat.
>
> A better approach would be to create a context.xml file and
> place it in
> the META-INF of your war file. When you do it this
> way, any changes to
> the context.xml file are done immediately when you redeploy
> the war
> file.
>
> Have a look here:
>
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
> "For Tomcat 5, unlike Tomcat 4.x, it is NOT recommended to
> place
> <Context> elements directly in the server.xml file.
> This is because it
> makes modifing the Context configuration more invasive
> since the main
> conf/server.xml file cannot be reloaded without restarting
> Tomcat."
>
>
>
> Mark Coffin
> [email protected]
>
> Phone: 905.632.0864
> 1.800.668.8486
> Fax: 905.632.2605
> www.aalsolutions.com
>
> -----Original Message-----
> From: Lukacs, Gabriel [mailto:[email protected]]
>
> Sent: May 4, 2009 5:18 AM
> To: Cool The Breezer; [email protected]
> Subject: Re: [Xmltask-users] Conditional insert based on
> xpath
>
> Hello,
> maybe it exists other solutions, but in
> such I am using the
> following 2 step code:
>
> <xmltask
> source="${tomcat.home}/conf/server.xml">
> <copy
> path="boolean(/Server/Service/Engine/Host/conte...@path='/doceng'])"
> property="is.path.available" />
> </xmltask>
>
> <if>
> (this if task is from antcontrib)
> <isfalse
> value="${is.path.available}"/>
> <then>
> ....your insert....
> </then>
> </if>
>
>
> -----Original Message-----
> From: Cool The Breezer [mailto:[email protected]]
>
> Sent: Monday, May 04, 2009 11:02 AM
> To: [email protected]
> Subject: [Xmltask-users] Conditional insert based on xpath
>
>
> Hi,
> I am currently using <insert> task
> for deploying my webapp. However
> sometimes, the context is inserted more than once and I
> have to perform
> conditional insert in target. Before inserting, I have to
> check whether
> path="/Server/Service/Engine/Host/conte...@path='/doceng']
> exists or
> not. If exists then dont insert otherwise insert. I was
> looking into
> "if" subtask but could not able to find any examples.
> Please find my
> code below and would appreciate your help.
>
> <target name="deploy_local">
> <echo
> message="(INFO): Please ensure that server is
> down, while deploying to localhost"/>
> <xmltask
> source="${tomcat.home}/conf/server.xml"
> dest="${tomcat.home}/conf/server.xml">
>
> <insert
> path="/Server/Service/Engine/Host/text()[1]"
> position="before">
>
> <![CDATA[
>
> <Context
> path="/doceng"
> reloadable="true" docBase="${docBase}">
>
> <Resource
> name="jdbc/docengdb"
> auth="Container"
>
>
> type="javax.sql.DataSource"
>
> driverClassName="${driverclassName}"
>
>
> url="${dburl}"
>
> username="${dbusername}"
>
> password="${dbpassword}"
>
> maxActive="${maxactive}"
>
> maxIdle="${maxidle}"
>
>
> maxWait="${maxwait}"/>
>
> </Context>
>
> ]]>
>
> </insert>
> </xmltask>
> </target>
>
>
>
>
>
> ------------------------------------------------------------------------
> ------
> Register Now & Save for Velocity, the Web Performance
> & Operations
> Conference from O'Reilly Media. Velocity features a full
> day of
> expert-led, hands-on workshops and two days of sessions
> from industry
> leaders in dedicated Performance & Operations tracks.
> Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Xmltask-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xmltask-users
>
> ------------------------------------------------------------------------
> ------
> Register Now & Save for Velocity, the Web Performance
> & Operations
> Conference from O'Reilly Media. Velocity features a full
> day of
> expert-led, hands-on workshops and two days of sessions
> from industry
> leaders in dedicated Performance & Operations tracks.
> Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Xmltask-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xmltask-users
>
>
>
>
> ****** CONFIDENTIALITY NOTICE ******
>
> NOTICE: This e-mail message and all attachments transmitted
> with it may contain legally privileged and confidential
> information intended solely for the use of the addressee. If
> the reader of this message is not the intended recipient,
> you are hereby notified that any reading, dissemination,
> distribution, copying, or other use of this message or its
> attachments is strictly prohibited. If you have received
> this message in error, please notify the sender immediately
> and delete this message from your system. Thank you.
>
>
>
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Xmltask-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xmltask-users