ManifestClassPath Ant Task
Converts a classpath into a space-separated list of items used to set the Manifest Class-Path attribute.
This is highly useful when modules are packaged together inside an Enterprise Application Archive (EAR). Library modules may be deployed inside an EAR, but (in the current J2EE specs), there's no way for such modules to be added to the classpath in the deployment descriptor; instead, each JAR is expected to have a Manifest Class-Path attribute identifying the exactly list of JARs that should be in the classpath. This Task is used to generate that list.
This task is implemented as org.apache.hivemind.ant.ManifestClassPath.
Parameters
Attribute | Description | Required |
---|---|---|
property | The name of a property to set as a result of executing the task. | Yes |
directory | If specified, then the directory attribute does two things:
|
No |
Parameters specified as nested elements
Examples
Generate a list of JARs inside the ${target} directory as relative paths and use it to set the Class-Path manifest attribute.
<manifestclasspath directory="${target}" property="manifest.class.path"> <classpath refid="build.class.path"/> </manifestclasspath> <jar . . .> <manifest> <attribute name="Class-Path" value="${manifest.class.path}"/> . . . </manifest> </jar>