• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

WAR file creation using Ant in Java Program

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I came to know that we can use Ant API in Java Programming to make the Dyanamic WAR creation. The scenario is like this -->
I have to select set of files and create some XML documents online and make them as WAR. I could able to make all of the above except WAR file generation.
I need some help how can I make use of ANT API in Java Program (A Servlet may be) to create a dynamic WAR file on the fly.

Thanks for your time and help in advance
Srinivas Ivaturi.
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
download the source of ant, more specifically the code part where they create the war file, copy the code, and there you go.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well in a build.xml it is pretty easy.
Here is one that I created, and I am very very new to Ant. Actually this is my first time ever using Ant.


Mark
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Srinivas,
If you're not already familiar with it, I'm just pointing out that as part of the Ant binaries download is the API documentation. While it doesn't include a complete example that I've noticed, the classes, including the War task class, do seem to be documented well enough to be able to piece things together.
If you're looking for more direction on getting started using the API, just ask.
(If you're having trouble finding the API documentation, take a look at ANT_HOME/docs/manual/api/index.html)
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic