<jar>

The <jar> task gives you the ability to create JAR files, which is useful when putting together distributions, backups, and so on. It is an implicit fileset that produces a JAR file from the files included in the set. The nested elements help to refine the set even further, as well as enabling you to specify the contents of the META-INF directory. Table 4.42 details the attributes of the task that makes creating JARs easy.

Table 4.42. Table of <jar> Attributes
Attributes Description
Required
destfile The name of the JAR file to be created.
Optional
basedir The name of the directory from which the files to jar are located.
compress Specifies whether the files will be compressed in the JAR file. Defaults to true.
defaultExcludes If false, ...

Get Ant Developer’s Handbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.