java left logo
java middle logo
java right logo
 

Home arrow Other API Tips arrow Ant arrow How to use Manifest task
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 3942
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use Manifest task E-mail
User Rating: / 3
PoorBest 

Manifest

Description

Creates a manifest file.

This task can be used to write a Manifest file, optionally replacing or updating an existing file.

Manifests are processed according to the Jar file specification.. Specifically, a manifest element consists of a set of attributes and sections. These sections in turn may contain attributes. Note in particular that this may result in manifest lines greater than 72 bytes being wrapped and continued on the next line.

Parameters

Attribute Description Required
file the manifest-file to create/update. Yes
mode One of "update" or "replace", default is "replace". No
encoding The encoding used to read the existing manifest when updating. No, defaults to UTF-8 encoding.

Nested elements

attribute

One attribute for the manifest file. Those attributes that are not nested into a section will be added to the "Main" section.

Attribute Description Required
name the name of the attribute. Yes
value the value of the attribute. Yes

section

A manifest section - you can nest attribute elements into sections.

Attribute Description Required
name the name of the section. No, if omitted it will be assumed to be the main section.

Examples

  <manifest file="MANIFEST.MF">

    <attribute name="Built-By" value="${user.name}"/>
    <section name="common">
      <attribute name="Specification-Title" value="Example"/>

      <attribute name="Specification-Version" value="${version}"/>
      <attribute name="Specification-Vendor" value="Example Organization"/>
      <attribute name="Implementation-Title" value="common"/>

      <attribute name="Implementation-Version" value="${version} ${TODAY}"/> 
      <attribute name="Implementation-Vendor" value="Example Corp."/>
    </section>

    <section name="common/class1.class">
      <attribute name="Sealed" value="false"/>
    </section>
  </manifest>

Creates or replaces the file MANIFEST.MF. Note that the Built-By attribute will take the value of the Ant property ${user.name}. The same is true for the ${version} and ${TODAY} properties. This example produces a MANIFEST.MF that contains package version identification for the package common.

The manifest produced by the above would look like this:

Manifest-Version: 1.0
Built-By: bodewig
Created-By: Apache Ant 1.5alpha

Name: common
Specification-Title: Example
Specification-Vendor: Example Organization
Implementation-Vendor: Example Corp.
Specification-Version: 1.1
Implementation-Version: 1.1 February 19 2002
Implementation-Title: common

Name: common/class1.class
Sealed: false

Source: Apache Ant


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.