Cari di Apache Ant 
    Apache Ant User Manual
Daftar Isi
(Sebelumnya) ManifestMimeMail (Berikutnya)
Apache Ant Tasks

ManifestClassPath

Manifestclasspath

Description

Converts a Path into a propertywhose value is appropriate for a Manifest'sClass-Path attribute.

This task is often used to work around command line limitations on Windowswhen using very long class paths when launching an application. The long classpath normally specified on the command line is replaced by a single (possiblyempty) jar file which an in-manifest Class-Path attribute whose value listsall the jar and zip files the class path should contain. The files referencedfrom this attribute must be found relatively to the jar file itself, usuallyin the same directory. The Java VM automically uses all file entries listedin the Class-Path attributes of a jar to locate/load classes. Note though thatit silently ignores entries for which it cannot find any corresponding file.

Note that the property value created may be longer than a manifest's maximum72 characters per line, but will be properly wrapped as per the Jarspecification by the <manifest> element, where thedefined property is re-referenced.

For this task to work properly the relative path from the file given in the jarfile attribute to the elements of the nested classpath must be the same as you expect them to be when deploying the jar.

since Apache Ant 1.7

Parameters

Attribute Description Required
property the name of the property to set. This property must not already be set. Yes
jarfile the filename for the Jar which will contain the manifest that will use the property this task will set. This file need not exist yet, but its parent directory must exist. Yes
maxParentLevels The maximum number of parent directories one is allowed to traverse to navigate from the jar file to the path entry. Put differently, the maximum number of .. which is allowed in the relative path from the jar file to a given class path enty. Specify 0 to enforce a path entry to be in the same directory (or one of its sub-directories) as the jar file itself. Defaults to 2 levels. No

Parameters specified as nested elements

classpath

A Path-like element, which can bedefined in-place, or refer to a path defined elsewhere using the<classpath refid="pathid" /> syntax.This classpath must not be empty, and is required.

Examples

 <manifestclasspath property="jar.classpath"   jarfile="build/acme.jar">  <classpath refid="classpath" /> </manifestclasspath>  

Assuming a path of id "classpath" was already defined, convert this path relatively to the build/ directory that will contain acme.jar, which can later be created with <jar> with a nested <manifest> element that lists an <attribute name="Class-Path" value="${jar.classpath}" />.

(Sebelumnya) ManifestMimeMail (Berikutnya)