• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to deploy application with Ant?

 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Balan Raj
Ranch Hand
Posts: 74
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all reply.
 
Mike Clark
author
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant sucks! But be cautious that depoyment work may be product dependent. For example, to deploy app. to Websphere need additional work than Tomcat.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic