• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Ant and War file

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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".
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic