source: other-projects/trunk/realistic-books/packages/AntInstaller/web/manual1.7.0/manual/CoreTasks/manifestclasspath.html@ 19253

Last change on this file since 19253 was 19253, checked in by davidb, 15 years ago

Establishing a source code repository for Veronica's Realistic Book's software

File size: 4.4 KB
Line 
1<!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16-->
17<html>
18
19<head>
20<meta http-equiv="Content-Language" content="en-us">
21<link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
22<title>ManifestClassPath Task</title>
23</head>
24
25<body>
26
27<h2><a name="manifestclasspath">Manifestclasspath</a></h2>
28
29<h3>Description</h3>
30<p>Converts a <a href="../using.html#path">Path</a> into a property
31whose value is appropriate for a <a href="manifest.html">Manifest</a>'s
32<code>Class-Path</code> attribute.</p>
33
34<p>This task is often used to work around command line limitations on Windows
35when using very long class paths when launching an application. The long class
36path normally specified on the command line is replaced by a single (possibly
37empty) jar file which an in-manifest Class-Path attribute whose value lists
38all the jar and zip files the class path should contain. The files referenced
39from this attribute must be found relatively to the jar file itself, usually
40in the same directory. The Java VM automically uses all file entries listed
41in the Class-Path attributes of a jar to locate/load classes. Note though that
42it silently ignores entries for which it cannot find any corresponding file.</p>
43
44<p>Note that the property value created may be longer than a manifest's maximum
4572 characters per line, but will be properly wrapped as per the Jar
46specification by the <code>&lt;manifest&gt;</code> element, where the
47defined property is re-referenced.</p>
48
49<p><em>since Ant 1.7</em></p>
50
51<h3>Parameters</h3>
52<table border="1" cellpadding="2" cellspacing="0">
53 <tr>
54 <td valign="top"><b>Attribute</b></td>
55 <td valign="top"><b>Description</b></td>
56 <td align="center" valign="top"><b>Required</b></td>
57 </tr>
58 <tr>
59 <td valign="top">property</td>
60 <td valign="top">the name of the property to set. This property must
61 not already be set.</td>
62 <td valign="top" align="center">Yes</td>
63 </tr>
64 <tr>
65 <td valign="top">jarfile</td>
66 <td valign="top">
67 the filename for the Jar which will contain the manifest that will
68 use the property this task will set. This file need not exist yet,
69 but its parent directory must exist.
70 </td>
71 <td valign="top" align="center">Yes</td>
72 </tr>
73 <tr>
74 <td valign="top">maxParentLevels</td>
75 <td valign="top">
76 The maximum number of parent directories one is allowed to traverse
77 to navigate from the jar file to the path entry. Put differently, the
78 maximum number of .. which is allowed in the relative path from the
79 jar file to a given class path enty. Specify 0 to enforce a path
80 entry to be in the same directory (or one of its sub-directories)
81 as the jar file itself. Defaults to 2 levels.</td>
82 <td valign="top" align="center">No</td>
83 </tr>
84</table>
85
86<h3>Parameters specified as nested elements</h3>
87<h4>classpath</h4>
88<p>A <a href="../using#path.html">Path-like</a> element, which can be
89defined in-place, or refer to a path defined elsewhere using the
90<code>&lt;classpath refid="<em>pathid</em>" /&gt;</code> syntax.
91This classpath must not be empty, and is required.</p>
92
93<h3>Examples</h3>
94<div id="example1">
95 <blockquote><pre>
96 &lt;manifestclasspath property="jar.classpath"
97 jarfile="build/acme.jar"&gt;
98 &lt;classpath refid="classpath" /&gt;
99 &lt;/manifestclasspath&gt;
100 </pre></blockquote>
101 <p>Assuming a path of id "classpath" was already defined, convert this
102 path relatively to the build/ directory that will contain acme.jar, which
103 can later be created with <code>&lt;jar&gt;</code> with a nested
104 <code>&lt;manifest&gt;</code> element that lists an
105 <code>&lt;attribute name="Class-Path" value="${jar.classpath}" /&gt;</code>.
106 </p>
107</div>
108
109
110
111</body>
112</html>
Note: See TracBrowser for help on using the repository browser.