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