This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes WAR file creation using Ant in Java Program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "WAR file creation using Ant in Java Program" Watch "WAR file creation using Ant in Java Program" New topic
Author

WAR file creation using Ant in Java Program

Srinivas Ivaturi
Ranch Hand

Joined: Jan 28, 2003
Posts: 50
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.
friso dejonge
Ranch Hand

Joined: Jul 11, 2002
Posts: 162
download the source of ant, more specifically the code part where they create the war file, copy the code, and there you go.


swimming certificate (A & B), shoelaces diploma, and some useless java ones.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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)


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WAR file creation using Ant in Java Program
 
Similar Threads
How to automate deployment of war in Tomcat through Ant
Creating WAR file using JAVA API
Using ANT API in Java Program
unable to create War using Ant
.war