File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant and War file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant and War file" Watch "Ant and War file" New topic
Author

Ant and War file

Zach Young
Greenhorn

Joined: Nov 15, 2005
Posts: 8
I'm really new to java and have a few questions.

Can ant be used to deploy a war file?

I have readed that a build.xml file must be created can this be used to deploy a web app?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes. You don't have to use Ant, you could use an IDE. Ant has tasks to perform all the steps required to build and deploy a web app. I'd advise you learn these steps (for whatever web container you are using) manually though before automating this process with Ant. Learning one new technology at a time is easier than trying to learn them all at once.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
This is how to create a war file for a webapp.
<war destfile="${webapps.dir}/ROOT.war" webxml="${webapps.dir}/ROOT/WEB-INF/web.xml">
<fileset dir="${webapps.dir}/ROOT" excludes="**/web.xml"/>
</war>

To Deploy to app servers, there are plugins available, as standard or addon to ANT, that can be used.
They are simple as Tomcat, deploy war="ROOT.war" host="HOSTNAME".
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ant and War file
 
Similar Threads
How to deploy the development structure?
Integrating Eclipse 3.4 and WebSphere 6.1
ANT
New to JBoss
Is it useful to deploy by a .war file?