You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

jarlib-resolve.html 6.9 KiB

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