<?xml version="1.0"?>
<!-- 
   Copyright 2004, 2005 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN"
	"http://xml.apache.org/forrest/dtd/document-v13.dtd" [
	<!ENTITY projectroot '../../'>
	<!ENTITY % common-links SYSTEM "../../links.ent">
	%common-links;
	]>
<document>
	<header>
		<title>ManifestClassPath Ant Task</title>
	</header>
	<body>
		<p>Converts a classpath into a space-separated list of items used to set the
			<code>Manifest Class-Path</code> attribute.</p>
		<p>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.</p>
		<p>This task is implemented as <link
			href="&apiroot;ant/ManifestClassPath.html">
			org.apache.hivemind.ant.ManifestClassPath</link>.</p>
		<section>
			<title>Parameters</title>
			<table>
				<tr>
					<th>Attribute</th>
					<th>Description</th>
					<th>Required</th>
				</tr>
				<tr>
					<td>property</td>
					<td>The name of a property to set as a result of executing the task.</td>
					<td>Yes</td>
				</tr>
				<tr>
					<td>directory</td>
					<td>If specified, then the directory attribute does two things: <ul> 
						<li>It acts as a filter, limiting the results to just those elements
						that are within the directory</li> <li>It strips off the directory
						as a prefix (plus the separator), creating results that are relative
						to the directory.</li> </ul> </td>
					<td>No</td>
				</tr>
			</table>
		</section>
		<section>
			<title>Parameters specified as nested elements</title>
			<section>
				<title>classpath</title>
				<p>A path-like structure, used to identify what the classpath should be.</p>
			</section>
		</section>
		<section>
			<title>Examples</title>
			<p>Generate a list of JARs inside the <code>${target}</code> directory as
				relative paths and use it to set the Class-Path manifest attribute.</p>
			<source><![CDATA[
<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>

]]> </source>
		</section>
	</body>
</document>
