aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes How to deploy application with Ant? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "How to deploy application with Ant?" Watch "How to deploy application with Ant?" New topic
Author

How to deploy application with Ant?

somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
How to deploy application with Ant?

Now, i'm using Eclipse + Ant + Tomcat +JBoss for develop my project. But i don't know how to config in build.xml .

Step :
1. Complie *.java in /src and keep class in /build/WEB-INF/classes
2. Pack all data in /build to test.war
3. Deploy test.war into Tomcat or JBoss


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
If your Tomcat as hot deployment enabled, it's enough to just copy the latest version of the .war file to the 'webapps' directory and Tomcat will redeploy the application automatically after a few seconds.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Balan Raj
Ranch Hand

Joined: Aug 26, 2003
Posts: 74
Hopefully my example in An earlier message should give u an idea abt implementing step 1 & 2.

packing all data - ant zip
deploy the build - ant copy ..

then u need to restart the servlet engine.. am not sure if you can do that with ant.. maybe..
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

then u need to restart the servlet engine.. am not sure if you can do that with ant.. maybe..


If hot deployment is enabled you dont need to restart.


Groovy
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Thank you for all reply.
Mike Clark
author
Ranch Hand

Joined: Aug 15, 2003
Posts: 83
And if hot deploy is not enabled, you can chain together Tomcat's Ant tasks to effectively mimic what hot deploy does. The Tomcat Ant tasks are described at

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant

Mike


Mike Clark<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0974514039/ref=jranch-20" target="_blank" rel="nofollow">Pragmatic Project Automation</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Originally posted by Mike Clark:
And if hot deploy is not enabled, you can chain together Tomcat's Ant tasks to effectively mimic what hot deploy does. The Tomcat Ant tasks are described at

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant

Mike


Can i use this solution in Ant 1.6 or not ? and How?
Mike Clark
author
Ranch Hand

Joined: Aug 15, 2003
Posts: 83
Originally posted by somkiat puisungnoen:
Can i use this solution in Ant 1.6 or not ? and How?


I'm using the Tomcat Ant tasks with Ant 1.6.2 and it's working fine.

I use the tasks in much the same way as prescribed by the Tomcat documentation:

http://jakarta.apache.org/tomcat/tomcat-5.5-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant

Mike
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Ant sucks! But be cautious that depoyment work may be product dependent. For example, to deploy app. to Websphere need additional work than Tomcat.


Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to deploy application with Ant?