1 | <html>
|
---|
2 |
|
---|
3 | <head>
|
---|
4 | <meta http-equiv="Content-Language" content="en-us">
|
---|
5 | <title>jarlib-resolve Task</title>
|
---|
6 | <link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
|
---|
7 | </head>
|
---|
8 |
|
---|
9 | <body>
|
---|
10 |
|
---|
11 | <h2><a name="jarlib-resolve">jarlib-resolve</a></h2>
|
---|
12 | <h3>Description</h3>
|
---|
13 | <p>Try to locate a jar to satisfy an extension and place
|
---|
14 | location of jar into property. The task allows you to
|
---|
15 | add a number of resolvers that are capable of locating a
|
---|
16 | library for a specific extension. Each resolver will be attempted
|
---|
17 | in specified order until library is found or no resolvers are left.
|
---|
18 | If no resolvers are left and failOnError is true then a BuildException
|
---|
19 | will be thrown.</p>
|
---|
20 |
|
---|
21 | <p>Note that this task
|
---|
22 | works with extensions as defined by the "Optional Package" specification.
|
---|
23 | For more information about optional packages, see the document
|
---|
24 | <em>Optional Package Versioning</em> in the documentation bundle for your
|
---|
25 | Java2 Standard Edition package, in file
|
---|
26 | <code>guide/extensions/versioning.html</code> or online at
|
---|
27 | <a href="http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html">
|
---|
28 | http://java.sun.com/j2se/1.3/docs/guide/extensions/versioning.html</a>.</p>
|
---|
29 | <p>See the Extension and ExtensionSet documentation for further details</p>
|
---|
30 |
|
---|
31 | <h3>Parameters</h3>
|
---|
32 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
33 | <tr>
|
---|
34 | <td valign="top"><b>Attribute</b></td>
|
---|
35 | <td valign="top"><b>Description</b></td>
|
---|
36 | <td align="center" valign="top"><b>Required</b></td>
|
---|
37 | </tr>
|
---|
38 | <tr>
|
---|
39 | <td valign="top">property</td>
|
---|
40 | <td valign="top">The name of property to set to library location.</td>
|
---|
41 | <td valign="top" align="center">Yes</td>
|
---|
42 | </tr>
|
---|
43 | <tr>
|
---|
44 | <td valign="top">failOnError</td>
|
---|
45 | <td valign="top">True if failure to locate library should result in build exception.</td>
|
---|
46 | <td valign="top" align="center">No, defaults to true.</td>
|
---|
47 | </tr>
|
---|
48 | <tr>
|
---|
49 | <td valign="top">checkExtension</td>
|
---|
50 | <td valign="top">True if libraries returned by nested resolvers should be checked to see if
|
---|
51 | they supply extension.</td>
|
---|
52 | <td valign="top" align="center">No, defaults to true.</td>
|
---|
53 | </tr>
|
---|
54 | </table>
|
---|
55 | <h3>Parameters specified as nested elements</h3>
|
---|
56 |
|
---|
57 | <h4>extension</h4>
|
---|
58 | <p><a href="../OptionalTypes/extension.html">Extension</a> the extension
|
---|
59 | to resolve. Must be present</p>
|
---|
60 |
|
---|
61 | <h4>location</h4>
|
---|
62 | <p>The location sub element allows you to look for a library in a
|
---|
63 | location relative to project directory.</p>
|
---|
64 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
65 | <tr>
|
---|
66 | <td valign="top"><b>Attribute</b></td>
|
---|
67 | <td valign="top"><b>Description</b></td>
|
---|
68 | <td align="center" valign="top"><b>Required</b></td>
|
---|
69 | </tr>
|
---|
70 | <tr>
|
---|
71 | <td valign="top">location</td>
|
---|
72 | <td valign="top">The pathname of library.</td>
|
---|
73 | <td valign="top" align="center">Yes</td>
|
---|
74 | </tr>
|
---|
75 | </table>
|
---|
76 |
|
---|
77 | <h4>url</h4>
|
---|
78 | <p>The url resolver allows you to download a library from a URL to a
|
---|
79 | local file.</p>
|
---|
80 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
81 | <tr>
|
---|
82 | <td valign="top"><b>Attribute</b></td>
|
---|
83 | <td valign="top"><b>Description</b></td>
|
---|
84 | <td align="center" valign="top"><b>Required</b></td>
|
---|
85 | </tr>
|
---|
86 | <tr>
|
---|
87 | <td valign="top">url</td>
|
---|
88 | <td valign="top">The URL to download.</td>
|
---|
89 | <td valign="top" align="center">Yes</td>
|
---|
90 | </tr>
|
---|
91 | <tr>
|
---|
92 | <td valign="top">destfile</td>
|
---|
93 | <td valign="top">The file to download URL into.</td>
|
---|
94 | <td valign="top" align="center">No, But one of destfile or
|
---|
95 | destdir must be present</td>
|
---|
96 | </tr>
|
---|
97 | <tr>
|
---|
98 | <td valign="top">destdir</td>
|
---|
99 | <td valign="top">The directory in which to place downloaded file.</td>
|
---|
100 | <td valign="top" align="center">No, But one of destfile or
|
---|
101 | destdir must be present</td>
|
---|
102 | </tr>
|
---|
103 | </table>
|
---|
104 |
|
---|
105 | <h4>ant</h4>
|
---|
106 | <p>The ant resolver allows you to run a ant build file to generate a library.</p>
|
---|
107 | <table border="1" cellpadding="2" cellspacing="0">
|
---|
108 | <tr>
|
---|
109 | <td valign="top"><b>Attribute</b></td>
|
---|
110 | <td valign="top"><b>Description</b></td>
|
---|
111 | <td align="center" valign="top"><b>Required</b></td>
|
---|
112 | </tr>
|
---|
113 | <tr>
|
---|
114 | <td valign="top">antfile</td>
|
---|
115 | <td valign="top">The build file.</td>
|
---|
116 | <td valign="top" align="center">Yes</td>
|
---|
117 | </tr>
|
---|
118 | <tr>
|
---|
119 | <td valign="top">destfile</td>
|
---|
120 | <td valign="top">The file that the ant build creates.</td>
|
---|
121 | <td valign="top" align="center">Yes</td>
|
---|
122 | </tr>
|
---|
123 | <tr>
|
---|
124 | <td valign="top">target</td>
|
---|
125 | <td valign="top">The target to run in build file.</td>
|
---|
126 | <td valign="top" align="center">No</td>
|
---|
127 | </tr>
|
---|
128 | </table>
|
---|
129 |
|
---|
130 | <h3>Examples</h3>
|
---|
131 | <p><b>Resolve Extension to file.</b> If file does not exist or file
|
---|
132 | does not implement extension then throw an exception.</p>
|
---|
133 | <pre>
|
---|
134 | <extension id="dve.ext"
|
---|
135 | extensionName="org.realityforge.dve"
|
---|
136 | specificationVersion="1.2"
|
---|
137 | specificationVendor="Peter Donald"/>
|
---|
138 |
|
---|
139 | <jarlib-resolve property="dve.library">
|
---|
140 | <extension refid="dve.ext"/>
|
---|
141 | <location location="/opt/jars/dve.jar"/>
|
---|
142 | </jarlib-resolve>
|
---|
143 | </pre>
|
---|
144 |
|
---|
145 | <p><b>Resolve Extension to url.</b> If url does not exist or can not write
|
---|
146 | to destfile or files does not implement extension then throw an exception.</p>
|
---|
147 | <pre>
|
---|
148 | <extension id="dve.ext"
|
---|
149 | extensionName="org.realityforge.dve"
|
---|
150 | specificationVersion="1.2"
|
---|
151 | specificationVendor="Peter Donald"/>
|
---|
152 |
|
---|
153 | <jarlib-resolve property="dve.library">
|
---|
154 | <extension refid="dve.ext"/>
|
---|
155 | <url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/>
|
---|
156 | </jarlib-resolve>
|
---|
157 | </pre>
|
---|
158 |
|
---|
159 | <p><b>Resolve Extension to file produce by ant build.</b> If file does not get produced
|
---|
160 | or ant file is missing or build fails then throw an exception (Note does not check
|
---|
161 | that library implements extension).</p>
|
---|
162 | <pre>
|
---|
163 | <extension id="dve.ext"
|
---|
164 | extensionName="org.realityforge.dve"
|
---|
165 | specificationVersion="1.2"
|
---|
166 | specificationVendor="Peter Donald"/>
|
---|
167 |
|
---|
168 | <jarlib-resolve property="dve.library" checkExtension="false">
|
---|
169 | <extension refid="dve.ext"/>
|
---|
170 | <ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/>
|
---|
171 | </jarlib-resolve>
|
---|
172 | </pre>
|
---|
173 |
|
---|
174 | <p><b>Resolve Extension via multiple methods.</b> First check local file to see if it implements
|
---|
175 | extension. If it does not then try to build it from source in parallel directory. If that
|
---|
176 | fails then finally try to download it from a website. If all steps fail then throw a build
|
---|
177 | exception.</p>
|
---|
178 | <pre>
|
---|
179 | <extension id="dve.ext"
|
---|
180 | extensionName="org.realityforge.dve"
|
---|
181 | specificationVersion="1.2"
|
---|
182 | specificationVendor="Peter Donald"/>
|
---|
183 |
|
---|
184 | <jarlib-resolve property="dve.library">
|
---|
185 | <extension refid="dve.ext"/>
|
---|
186 | <location location="/opt/jars/dve.jar"/>
|
---|
187 | <ant antfile="../dve/build.xml" target="main" destfile="lib/dve.jar"/>
|
---|
188 | <url url="http://www.realityforge.net/jars/dve.jar" destfile="lib/dve.jar"/>
|
---|
189 | </jarlib-resolve>
|
---|
190 | </pre>
|
---|
191 |
|
---|
192 | <hr><p align="center">Copyright © 2002,2004 The Apache Software Foundation.
|
---|
193 | All rights Reserved.</p>
|
---|
194 |
|
---|
195 | </body>
|
---|
196 | </html>
|
---|
197 |
|
---|