VisualBuilder
  Home > Java > Tutorials > Creating the War files using the ANT Scripts - Ant Tutorial
Tell a friend
Link to us
Total Members
      Members: 84661
     
Sitemap Forum Chat
Home
Ant Tutorial Home
1 . Introduction
2 . Library Dependencies
3 . Necessary Elements Of the Build File-1
4 . Neccessary Elements Of the Build File-2
5 . Writing Your First Buildfile
6 . Integration Of Ant With IDE Eclipse
7 . Command-line Arguments
8 . ANT Command Options Summary
9 . Properties in ANT
10 . Example to print the existing properties using ANT.
11 . Adding lib files in Classpath from the Ant Script
12 . Creating and deleting the directories from Ant Scripts.
13 . Working with Files.
14 . Example to Create the Jar files
15 . Creating the War files using the ANT Scripts
16 . Ear Command in Ant
17 . Generics
18 . Annotation Processing Tool ( APT )
19 . More Enhancements in Tiger.
20 . Java Compiler (javac) and Debugger
21 . Java Web Start in J2SE 5.0
22 . General Deployment Enhancements in J2SE 5.0
 
 
Java Home
Java Members (27650)
Java Member Articles ( 40 )
Java Discussion (275)
Java Q & A ( 174 )
- Java Ask Question
- Java Questions
- Java Unanswered Questions
Java Resources
Java Source Code (1096)
Java Articles (551)
Java Blogs (118)
Java Jobs (797)
Java Components (85)
Java Books (169)
Java Websites (127)
Java News (103)
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.Net Security,Internationalisation And Deployment
ASP.NET Tutorial
C# Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (451 )
Source Code (3275 )
Articles (359 )
Books (372 )
Components (1596 )
News (892 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise

Java ant Tutorial
 Creating the War files using the ANT Scripts
  << Prev: Example to Create the Jar files Next: Ear Command in Ant >>

This task is an extension to jar task. The war file is a web archieve file in the java environment and is ready to deploy on the web servers. The War task is a shortcut for specifying the particular layout of a WAR file.


The following table will demonstrate the attributes for the war task.









































































































Attribute


Description


Required


destfile

the WAR file to create. Exactly one of the two.

warfile

Deprecated name of the file to create -use destfile instead.

webxml

The servlet configuration descriptor to use (WEB-INF/web.xml). Yes, unless needxmlfile is true, the file is pulled in via a nested fileset, or an existing WAR file is being updated.

needxmlfile

Flag to indicate whether or not the web.xml file is needed. I=it should be set to false when generating servlet 2.5+ WAR files without a web.xml file. Since Ant 1.7 No -default "true"

basedir

the directory from which to jar the files. No

compress

Not only store data but also compress them, defaults to true. Unless you set the keepcompression attribute to false, this will apply to the entire archive, not only the files you've added while updating. No

keepcompression

For entries coming from existing archives (like nested zipfileset s or while updating the archive), keep the compression as it has been originally instead of using the compress attribute. Defaults false. Since Ant 1.6 No

encoding

The character encoding to use for filenames inside the archive. Defaults to UTF8. It is not recommended to change this value as the created archive will most likely be unreadable for Java otherwise. No

filesonly

Store only file entries, defaults to false No

includes

comma- or space-separated list of patterns of files that must be included. All files are included when omitted. No

includesfile

the name of a file. Each line of this file is taken to be an include pattern No

excludes

comma- or space-separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. No

excludesfile

the name of a file. Each line of this file is taken to be an exclude pattern No

defaultexcludes

indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. No

manifest

the manifest file to use. No

update

indicates whether to update or overwrite the destination file if it already exists. Default is "false". No

duplicate

behavior when a duplicate file is found. Valid values are "add", "preserve", and "fail". The default value is "add". No

roundup

Whether the file modification times will be rounded up to the next even number of seconds.
Zip archives store file modification times with a granularity of two seconds, so the times will either be rounded up or down. If you round down, the archive will always seem out-of-date when you rerun the task, so the default is to round up. Rounding up may lead to a different type of problems like JSPs inside a web archive that seem to be slightly more recent than precompiled pages, rendering precompilation useless.
Defaults to true. Since Ant 1.6.2
No

level

Non-default level at which file compression should be performed. Valid values range from 0 (no compression/fastest) to 9 (maximum compression/slowest). Since Ant 1.7 No

 


  << Prev: Example to Create the Jar files Next: Ear Command in Ant >>
Java Ant Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
 
ADVERTISEMENT
Partner List
Code Project
ASP Alliance
More
 
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising