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.

javadoc.html 34 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  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. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. -->
  15. <html>
  16. <head>
  17. <meta http-equiv="Content-Language" content="en-us">
  18. <link rel="stylesheet" type="text/css" href="../stylesheets/style.css">
  19. <title>Javadoc Task</title>
  20. </head>
  21. <body>
  22. <h2 id="javadoc">Javadoc/<em>Javadoc2</em></h2>
  23. <p><em><u>Deprecation</u>: the <code>javadoc2</code> task simply points to the <code>javadoc</code>
  24. task and it's there for backwards compatibility reasons. Since this task will be removed in future
  25. versions, you are strongly encouraged to use <a href="javadoc.html">javadoc</a> instead.</em></p>
  26. <h3>Description</h3>
  27. <p>Generates code documentation using the <kbd>javadoc</kbd> tool.</p>
  28. <p>The source directory will be recursively scanned for Java source files to process but only those
  29. matching the inclusion rules, and not matching the exclusions rules will be passed to
  30. the <kbd>javadoc</kbd> tool. This allows wildcards to be used to choose between package names,
  31. reducing verbosity and management costs over time. This task, however, has no notion of
  32. &quot;changed&quot; files, unlike the <a href="javac.html">javac</a> task. This means all packages
  33. will be processed each time this task is run. In general, however, this task is used much less
  34. frequently.</p>
  35. <p><strong>Note</strong>: since <kbd>javadoc</kbd>
  36. calls <code class="code">System.exit()</code>, <kbd>javadoc</kbd> cannot be run inside the same
  37. JVM as Apache Ant without breaking functionality. For this reason, this task always forks JVM. This
  38. overhead is not significant since <kbd>javadoc</kbd> is normally a heavy application and will be
  39. called infrequently.</p>
  40. <p><strong>Note</strong>: the <var>packagelist</var> attribute allows you to specify the list of
  41. packages to document outside of the Ant file. It's a much better practice to include everything
  42. inside the <code>build.xml</code> file. This option was added in order to make it easier to migrate
  43. from regular makefiles, where you would use this option of <kbd>javadoc</kbd>. The packages
  44. listed in <var>packagelist</var> are not checked, so the task performs even if some packages are
  45. missing or broken. Use this option if you wish to convert from an existing makefile. Once things are
  46. running you should then switch to the regular notation.</p>
  47. <p>In the table below, 1.2 means available if your current JVM is exactly of version 1.2 (not 1.3 or
  48. later), 1.4+ for any JVM of at least version 1.4, otherwise any JVM of at least version 1.2 is
  49. acceptable. <em>JDKs prior to 1.4 are no longer supported.</em> If you specify
  50. the <var>executable</var> attribute it is up to you to ensure that this command supports the
  51. attributes you wish to use.</p>
  52. <p><strong>Note</strong>: When generating the JavaDocs for classes which contains annotations you
  53. maybe get a <code class="output">java.lang.ClassCastException:
  54. com.sun.tools.javadoc.ClassDocImpl</code>. This is
  55. due <a href="https://bugs.openjdk.java.net/browse/JDK-6442982" target="_top">bug 6442982</a>. The
  56. cause is that <kbd>javadoc</kbd> cannot find the implementations of used annotations. The
  57. workaround is providing the jars with these implementations (like
  58. JAXBs <code class="code">@XmlType</code>, ...) to <code>&lt;javadoc&gt;</code>
  59. using <var>classpath</var>, <var>classpathref</var> attributes or
  60. nested <code>&lt;classpath&gt;</code> element.</p>
  61. <p><strong>Note</strong>: many problems with running <kbd>javadoc</kbd> stem from command lines
  62. that have become too long&mdash;even though the error message doesn't give the slightest hint this
  63. may be the problem. If you encounter problems with the task, try to set
  64. the <var>useexternalfile</var> attribute to <q>true</q> first.</p>
  65. <p>If you use multiple ways to specify where <kbd>javadoc</kbd> should be looking for sources, your
  66. result will be the union of all specified documentations. If you, e.g., specify
  67. a <var>sourcepath</var> attribute and also a nested <code>packageset</code> both pointing at the
  68. same directory your <var>excludepackagenames</var> attribute won't have any effect unless it agrees
  69. with the <var>exclude</var> patterns of the <code>packageset</code> (and vice versa).</p>
  70. <h3>Parameters</h3>
  71. <table class="attr">
  72. <tr>
  73. <th scope="col">Attribute</th>
  74. <th scope="col">Description</th>
  75. <th scope="col">Availability on Java</th>
  76. <th scope="col">Required</th>
  77. </tr>
  78. <tr>
  79. <td>sourcepath</td>
  80. <td>Specify where to find source files</td>
  81. <td>all</td>
  82. <td rowspan="4">At least one of the three or
  83. nested <code>&lt;sourcepath&gt;</code>, <code>&lt;fileset&gt;</code>,
  84. <code>module</code> or <code>&lt;packageset&gt;</code></td>
  85. or <code>&lt;packageset&gt;</code></td>
  86. </tr>
  87. <tr>
  88. <td>sourcepathref</td>
  89. <td>Specify where to find source files by <a href="../using.html#references">reference</a> to a
  90. <var>sourcepath</var> defined elsewhere.</td>
  91. <td class="left">all</td>
  92. </tr>
  93. <tr>
  94. <td>sourcefiles</td>
  95. <td>Comma separated list of source files&mdash;see also the nested <code>source</code>
  96. element.</td>
  97. <td class="left">all</td>
  98. </tr>
  99. <tr>
  100. <td>modulenames</td>
  101. <td>Comma separated list of module names -- see also
  102. the nested <code>module</code> element. <em>since Ant 1.10.6</em></td>
  103. <td>all</td>
  104. </tr>
  105. <tr>
  106. <td>destdir</td>
  107. <td>Destination directory for output files</td>
  108. <td>all</td>
  109. <td>Yes, unless a <var>doclet</var> has been specified.</td>
  110. </tr>
  111. <tr>
  112. <td>maxmemory</td>
  113. <td>Max amount of memory to allocate to the <kbd>javadoc</kbd> JVM</td>
  114. <td>all</td>
  115. <td>No</td>
  116. </tr>
  117. <tr>
  118. <td>packagenames</td>
  119. <td>Comma separated list of package files (with terminating wildcard)&mdash;see also the
  120. nested <code>package</code> element.</td>
  121. <td>all</td>
  122. <td>No</td>
  123. </tr>
  124. <tr>
  125. <td>packageList</td>
  126. <td>The name of a file containing the packages to process</td>
  127. <td>all</td>
  128. <td>No</td>
  129. </tr>
  130. <tr>
  131. <td>classpath</td>
  132. <td>Specify where to find user class files</td>
  133. <td>all</td>
  134. <td>No</td>
  135. </tr>
  136. <tr>
  137. <td>Bootclasspath</td>
  138. <td>Override location of class files loaded by the bootstrap class loader</td>
  139. <td>all</td>
  140. <td>No</td>
  141. </tr>
  142. <tr>
  143. <td>classpathref</td>
  144. <td>Specify where to find user class files by <a href="../using.html#references">reference</a>
  145. to a <var>classpath</var> defined elsewhere.</td>
  146. <td>all</td>
  147. <td>No</td>
  148. </tr>
  149. <tr>
  150. <td>bootclasspathref</td>
  151. <td>Override location of class files loaded by the bootstrap class loader
  152. by <a href="../using.html#references">reference</a> to a <var>bootclasspath</var> defined
  153. elsewhere.</td>
  154. <td>all</td>
  155. <td>No</td>
  156. </tr>
  157. <tr>
  158. <td>Extdirs</td>
  159. <td>Override location of installed extensions</td>
  160. <td>all</td>
  161. <td>No</td>
  162. </tr>
  163. <tr>
  164. <td>Overview</td>
  165. <td>Read overview documentation from HTML file</td>
  166. <td>all</td>
  167. <td>No</td>
  168. </tr>
  169. <tr>
  170. <td>access</td>
  171. <td>Access mode: one of <q>public</q>, <q>protected</q>, <q>package</q>, or <q>private</q></td>
  172. <td>all</td>
  173. <td>No; default is <q>protected</q></td>
  174. </tr>
  175. <tr>
  176. <td>Public</td>
  177. <td>Show only public classes and members</td>
  178. <td>all</td>
  179. <td>No</td>
  180. </tr>
  181. <tr>
  182. <td>Protected</td>
  183. <td>Show protected/public classes and members (default)</td>
  184. <td>all</td>
  185. <td>No</td>
  186. </tr>
  187. <tr>
  188. <td>Package</td>
  189. <td>Show package/protected/public classes and members</td>
  190. <td>all</td>
  191. <td>No</td>
  192. </tr>
  193. <tr>
  194. <td>Private</td>
  195. <td>Show all classes and members</td>
  196. <td>all</td>
  197. <td>No</td>
  198. </tr>
  199. <tr>
  200. <td>Old</td>
  201. <td>Generate output using JDK 1.1 emulating doclet.<br/><strong>Note</strong>: <em>Since Ant
  202. 1.8.0</em> this attribute has no effect because <kbd>javadoc</kbd> of Java 1.4 and later
  203. does not support the <kbd>-1.1</kbd> switch anymore.</td>
  204. <td>1.2</td>
  205. <td>No</td>
  206. </tr>
  207. <tr>
  208. <td>Verbose</td>
  209. <td>Output messages about what <kbd>javadoc</kbd> is doing</td>
  210. <td>all</td>
  211. <td>No</td>
  212. </tr>
  213. <tr>
  214. <td>Locale</td>
  215. <td>Locale to be used, e.g. <q>en_US</q> or <q>en_US_WIN</q></td>
  216. <td>all</td>
  217. <td>No</td>
  218. </tr>
  219. <tr>
  220. <td>Encoding</td>
  221. <td>Source file encoding name</td>
  222. <td>all</td>
  223. <td>No</td>
  224. </tr>
  225. <tr>
  226. <td>Version</td>
  227. <td>Include <code>@version</code> paragraphs</td>
  228. <td>all</td>
  229. <td>No</td>
  230. </tr>
  231. <tr>
  232. <td>Use</td>
  233. <td>Create class and package usage pages</td>
  234. <td>all</td>
  235. <td>No</td>
  236. </tr>
  237. <tr>
  238. <td>Author</td>
  239. <td>Include <code>@author</code> paragraphs</td>
  240. <td>all</td>
  241. <td>No</td>
  242. </tr>
  243. <tr>
  244. <td>Splitindex</td>
  245. <td>Split index into one file per letter</td>
  246. <td>all</td>
  247. <td>No</td>
  248. </tr>
  249. <tr>
  250. <td>Windowtitle</td>
  251. <td>Browser window title for the documentation (text)</td>
  252. <td>all</td>
  253. <td>No</td>
  254. </tr>
  255. <tr>
  256. <td>Doctitle</td>
  257. <td>Include title for the package index (first) page (HTML code)</td>
  258. <td>all</td>
  259. <td>No</td>
  260. </tr>
  261. <tr>
  262. <td>Header</td>
  263. <td>Include header text for each page (HTML code)</td>
  264. <td>all</td>
  265. <td>No</td>
  266. </tr>
  267. <tr>
  268. <td>Footer</td>
  269. <td>Include footer text for each page (HTML code)</td>
  270. <td>all</td>
  271. <td>No</td>
  272. </tr>
  273. <tr>
  274. <td>bottom</td>
  275. <td>Include bottom text for each page (HTML code)</td>
  276. <td>all</td>
  277. <td>No</td>
  278. </tr>
  279. <tr>
  280. <td>link</td>
  281. <td>Create links to <code>javadoc</code> output at the given URL&mdash;see also the
  282. nested <code>link</code> element.</td>
  283. <td>all</td>
  284. <td>No</td>
  285. </tr>
  286. <tr>
  287. <td>linkoffline</td>
  288. <td>Link to docs at <samp><em>url</em></samp> using package list
  289. at <samp><em>alt-url</em></samp> by specifying a
  290. value <q><em>url</em>&nbsp;<em>alt-url</em></q> (space as separator). A shorthand for the
  291. nested <code>link</code> element with <var>offline</var>=<q>true</q>.</td>
  292. <td>all</td>
  293. <td>No</td>
  294. </tr>
  295. <tr>
  296. <td>group</td>
  297. <td>Group specified packages together in overview page. The format is as
  298. described <a href="#groupattribute">below</a>&mdash;see also the nested <code>group</code>
  299. element.</td>
  300. <td>all</td>
  301. <td>No</td>
  302. </tr>
  303. <tr>
  304. <td>nodeprecated</td>
  305. <td>Do not include <code>@deprecated</code> information</td>
  306. <td>all</td>
  307. <td>No</td>
  308. </tr>
  309. <tr>
  310. <td>nodeprecatedlist</td>
  311. <td>Do not generate deprecated list</td>
  312. <td>all</td>
  313. <td>No</td>
  314. </tr>
  315. <tr>
  316. <td>notree</td>
  317. <td>Do not generate class hierarchy</td>
  318. <td>all</td>
  319. <td>No</td>
  320. </tr>
  321. <tr>
  322. <td>noindex</td>
  323. <td>Do not generate index</td>
  324. <td>all</td>
  325. <td>No</td>
  326. </tr>
  327. <tr>
  328. <td>nohelp</td>
  329. <td>Do not generate help link</td>
  330. <td>all</td>
  331. <td>No</td>
  332. </tr>
  333. <tr>
  334. <td>nonavbar</td>
  335. <td>Do not generate navigation bar</td>
  336. <td>all</td>
  337. <td>No</td>
  338. </tr>
  339. <tr>
  340. <td>serialwarn</td>
  341. <td>Generate warning about <code>@serial</code> tag</td>
  342. <td>all</td>
  343. <td>No</td>
  344. </tr>
  345. <tr>
  346. <td>helpfile</td>
  347. <td>Specifies the HTML help file to use</td>
  348. <td>all</td>
  349. <td>No</td>
  350. </tr>
  351. <tr>
  352. <td>stylesheetfile</td>
  353. <td>Specifies the CSS stylesheet to use</td>
  354. <td>all</td>
  355. <td>No</td>
  356. </tr>
  357. <tr>
  358. <td>charset</td>
  359. <td>Charset for cross-platform viewing of generated documentation</td>
  360. <td>all</td>
  361. <td>No</td>
  362. </tr>
  363. <tr>
  364. <td>docencoding</td>
  365. <td>Output file encoding name</td>
  366. <td>all</td>
  367. <td>No</td>
  368. </tr>
  369. <tr>
  370. <td>doclet</td>
  371. <td>Specifies the class file that starts the doclet used in generating the
  372. documentation&mdash;see also the nested <code>doclet</code> element.</td>
  373. <td>all</td>
  374. <td>No</td>
  375. </tr>
  376. <tr>
  377. <td>docletpath</td>
  378. <td>Specifies the path to the doclet class file that is specified with the <kbd>-doclet</kbd>
  379. option.</td>
  380. <td>all</td>
  381. <td>No</td>
  382. </tr>
  383. <tr>
  384. <td>docletpathref</td>
  385. <td>Specifies the path to the doclet class file that is specified with the <kbd>-doclet</kbd>
  386. option by <a href="../using.html#references">reference</a> to a path defined elsewhere.</td>
  387. <td>all</td>
  388. <td>No</td>
  389. </tr>
  390. <tr>
  391. <td>additionalparam</td>
  392. <td>Lets you add additional parameters to the <kbd>javadoc</kbd> command line. Useful for
  393. doclets. Parameters containing spaces need to be quoted using &amp;quot;&mdash;see also the
  394. nested <code>arg</code> element.</td>
  395. <td>all</td>
  396. <td>No</td>
  397. </tr>
  398. <tr>
  399. <td>failonerror</td>
  400. <td>Stop the build process if the command exits with a return code other than <q>0</q>.</td>
  401. <td>all</td>
  402. <td>No</td>
  403. </tr>
  404. <tr>
  405. <td>failonwarning</td>
  406. <td>Stop the build process if a warning is emitted&mdash;i.e. if <kbd>javadoc</kbd>'s output
  407. contains the word <q>warning</q>. <em>since Ant 1.9.4</em></td>
  408. <td>all</td>
  409. <td>No</td>
  410. </tr>
  411. <tr>
  412. <td>excludepackagenames</td>
  413. <td>comma separated list of packages you don't want docs for&mdash;see also the
  414. nested <code>excludepackage</code> element.</td>
  415. <td>all</td>
  416. <td>No</td>
  417. </tr>
  418. <tr>
  419. <td>defaultexcludes</td>
  420. <td>indicates whether default excludes should be used (<q>yes|no</q>).</td>
  421. <td>all</td>
  422. <td>No; defaults to <q>yes</q></td>
  423. </tr>
  424. <tr>
  425. <td>useexternalfile</td>
  426. <td>indicates whether the source file names specified in <var>srcfiles</var> or as
  427. nested <code>source</code> elements should be written to a temporary file to make the command
  428. line shorter. Also applies to the package names specified via the <var>packagenames</var>
  429. attribute or nested <code>package</code> elements. <em>Since Ant 1.7.0</em>, also applies to
  430. all the other command line options. (<q>yes|no</q>).</td>
  431. <td>all</td>
  432. <td>No; default is <q>no</q></td>
  433. </tr>
  434. <tr>
  435. <td>source</td>
  436. <td>Enable <kbd>javadoc</kbd> to handle Java language features. Set this to <q>1.4</q> to
  437. document code that compiles using <kbd>javac -source 1.4</kbd>, etc.</td>
  438. <td>1.4+</td>
  439. <td>No; default can be provided using the magic
  440. <a href="../javacprops.html#source"><code>ant.build.javac.source</code></a> property.</td>
  441. </tr>
  442. <tr>
  443. <td>linksource</td>
  444. <td>Generate hyperlinks to source files. <em>since Ant 1.6</em>. (<q>yes|no</q>).</td>
  445. <td>1.4+</td>
  446. <td>No; default is <q>no</q></td>
  447. </tr>
  448. <tr>
  449. <td>breakiterator</td>
  450. <td>Use the new break iterator algorithm. <em>since Ant 1.6</em>. (<q>yes|no</q>).</td>
  451. <td>1.4+</td>
  452. <td>No; default is <q>no</q></td>
  453. </tr>
  454. <tr>
  455. <td>noqualifier</td>
  456. <td>Enables the <kbd>-noqualifier</kbd> argument&mdash;must be <q>all</q> or a colon separated
  457. list of packages. <em>since Ant 1.6</em>.</td>
  458. <td>1.4+</td>
  459. <td>No</td>
  460. </tr>
  461. <tr>
  462. <td>includenosourcepackages</td>
  463. <td>If set to <q>true</q>, packages that don't contain Java source but
  464. a <samp>package.html</samp> will get documented as well. <em>since Ant 1.6.3</em>.</td>
  465. <td>all</td>
  466. <td>No; default is <q>false</q></td>
  467. </tr>
  468. <tr>
  469. <td>executable</td>
  470. <td>Specify a particular <kbd>javadoc</kbd> executable to use in place of the default binary
  471. (found in the same JDK as Ant is running in). <em>since Ant 1.6.3</em>.</td>
  472. <td>all</td>
  473. <td>No</td>
  474. </tr>
  475. <tr>
  476. <td>docfilessubdirs</td>
  477. <td>Enables deep-copying of <samp>doc-files</samp> subdirectories. <em>since Ant
  478. 1.8.0</em>.</td>
  479. <td>1.4</td>
  480. <td>No; defaults to <q>false</q></td>
  481. </tr>
  482. <tr>
  483. <td>excludedocfilessubdir</td>
  484. <td>Colon-separated list of <samp>doc-files</samp> subdirectories to exclude
  485. if <var>docfilessubdirs</var> is true. <em>since Ant 1.8.0</em>.</td>
  486. <td>1.4</td>
  487. <td>No</td>
  488. </tr>
  489. <tr>
  490. <td>postProcessGeneratedJavadocs</td>
  491. <td>Whether to post-process the generated javadocs in order to mitigate
  492. CVE-2013-1571. <em>Since Ant 1.9.2</em><br/> There is a frame injection attack possible in
  493. javadocs generated by Oracle JDKs prior to Java 7 update 25
  494. (<a href="https://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#jpi-upt"
  495. target="_top">details</a>). When this flag is set to <q>true</q>, Ant will check whether the
  496. docs are vulnerable and will try to fix them.</td>
  497. <td>1.4</td>
  498. <td>No; defaults to <q>true</q></td>
  499. </tr>
  500. <tr>
  501. <td>modulesourcepath</td>
  502. <td>Specify where to find module source files
  503. <em>since Ant 1.10.6</em></td>
  504. <td>all</td>
  505. <td>No</td>
  506. </tr>
  507. <tr>
  508. <td>modulesourcepathref</td>
  509. <td>Specify where to find module source files by <a
  510. href="../using.html#references">reference</a> to a PATH defined elsewhere.
  511. <em>since Ant 1.10.6</em></td>
  512. <td>all</td>
  513. <td>No</td>
  514. </tr>
  515. <tr>
  516. <td>modulepath</td>
  517. <td>Specify where to find module files
  518. <em>since Ant 1.10.6</em></td>
  519. <td>all</td>
  520. <td>No</td>
  521. </tr>
  522. <tr>
  523. <td>modulepathref</td>
  524. <td>Specify where to find module files by <a
  525. href="../using.html#references">reference</a> to a PATH defined elsewhere.
  526. <em>since Ant 1.10.6</em></td>
  527. <td>all</td>
  528. <td>No</td>
  529. </tr>
  530. </table>
  531. <h4 id="groupattribute">Format of the group attribute</h4>
  532. <p>The arguments are comma-delimited. Each single argument is 2 space-delimited strings, where the
  533. first one is the group's title and the second one a colon delimited list of packages.</p>
  534. <p>If you need to specify more than one group, or a group whose title contains a comma or a space
  535. character, using <a href="#groupelement">nested <code>group</code> elements</a> is highly
  536. recommended.</p>
  537. <p>E.g.:</p>
  538. <pre>group=&quot;XSLT_Packages org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*&quot;</pre>
  539. <h3>Parameters specified as nested elements</h3>
  540. <h4>packageset</h4>
  541. <p>A <a href="../Types/dirset.html">DirSet</a>. All matched directories that contain Java source
  542. files will be passed to <kbd>javadoc</kbd> as package names. Package names are created from the
  543. directory names by translating the directory separator into dots. Ant assumes the base directory of
  544. the <code>packageset</code> points to the root of a package hierarchy.</p>
  545. <p>The <var>packagenames</var>, <var>excludepackagenames</var> and <var>defaultexcludes</var>
  546. attributes of the task have no effect on the nested <code>&lt;packageset&gt;</code> elements.</p>
  547. <h4>fileset</h4>
  548. <p>A <a href="../Types/fileset.html">FileSet</a>. All matched files will be passed
  549. to <kbd>javadoc</kbd> as source files. Ant will automatically add the include
  550. pattern <samp>**/*.java</samp> (and <samp>**/package.html</samp>
  551. if <var>includenosourcepackages</var> is <q>true</q>) to these filesets.</p>
  552. <p>Nested filesets can be used to document sources that are in the default package or if you want to
  553. exclude certain files from documentation. If you want to document all source files and don't use
  554. the default package, <code>packageset</code>s should be used instead as this increases performance
  555. of <kbd>javadoc</kbd>.</p>
  556. <p>The <var>packagenames</var>, <var>excludepackagenames</var> and <var>defaultexcludes</var>
  557. attributes of the task have no effect on the nested <code>&lt;fileset&gt;</code> elements.</p>
  558. <h4>sourcefiles</h4>
  559. <p>A container for arbitrary file system based <a href="../Types/resources.html#collection">resource
  560. collections</a>. All files contained in any of the nested collections (this includes nested
  561. filesets, filelists or paths) will be passed to javadoc as source files.</p>
  562. <h4>package</h4>
  563. <p>Same as one entry in the list given by <var>packagenames</var>.</p>
  564. <h5>Parameters</h5>
  565. <table class="attr">
  566. <tr>
  567. <th scope="col">Attribute</th>
  568. <th scope="col">Description</th>
  569. <th scope="col">Required</th>
  570. </tr>
  571. <tr>
  572. <td>name</td>
  573. <td>The package name (may be a wildcard)</td>
  574. <td>Yes</td>
  575. </tr>
  576. </table>
  577. <h4>excludepackage</h4>
  578. <p>Same as one entry in the list given by <var>excludepackagenames</var>.</p>
  579. <h5>Parameters</h5>
  580. Same as for <code>package</code>.
  581. <h4>module</h4>
  582. <p><em>since Ant 1.10.6</em></p>
  583. <p>Same as one entry in the list given by <code>modulenames</code>.</p>
  584. <h5>Parameters</h5>
  585. <table width="90%" border="1" cellpadding="2" cellspacing="0">
  586. <tr>
  587. <td scope="col"><b>Attribute</b></td>
  588. <td scope="col"><b>Description</b></td>
  589. <td scope="col"><b>Required</b></td>
  590. </tr>
  591. <tr>
  592. <td>name</td>
  593. <td>The module name</td>
  594. <td>Yes</td>
  595. </tr>
  596. </table>
  597. <h4>source</h4>
  598. <p>Same as one entry in the list given by <var>sourcefiles</var>.</p>
  599. <h5>Parameters</h5>
  600. <table class="attr">
  601. <tr>
  602. <th scope="col">Attribute</th>
  603. <th scope="col">Description</th>
  604. <th scope="col">Required</th>
  605. </tr>
  606. <tr>
  607. <td>file</td>
  608. <td>The source file to document</td>
  609. <td>Yes</td>
  610. </tr>
  611. </table>
  612. <h4>doctitle</h4>
  613. <p>Same as the <var>doctitle</var> attribute, but you can nest text inside the element this way.</p>
  614. <p>If the nested text contains line breaks, you must use the <var>useexternalfile</var> attribute
  615. and set it to <q>true</q>.</p>
  616. <h4>header</h4>
  617. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  618. <h4>footer</h4>
  619. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  620. <h4>bottom</h4>
  621. <p>Similar to <code>&lt;doctitle&gt;</code>.</p>
  622. <h4>link</h4>
  623. <p>Create link to <kbd>javadoc</kbd> output at the given URL. This performs the same role as
  624. the <var>link</var> and <var>linkoffline</var> attributes. You can use either syntax (or both at
  625. once), but with the nested elements you can easily specify multiple occurrences of the
  626. arguments.</p>
  627. <h5>Parameters</h5>
  628. <table class="attr">
  629. <tr>
  630. <th scope="col">Attribute</th>
  631. <th scope="col">Description</th>
  632. <th scope="col">Required</th>
  633. </tr>
  634. <tr>
  635. <td>href</td>
  636. <td>The URL for the external documentation you wish to link to. This can be an absolute URL, or
  637. a relative file name.</td>
  638. <td>Yes</td>
  639. </tr>
  640. <tr>
  641. <td>offline</td>
  642. <td><q>true</q> if this link is not available online at the time of generating the
  643. documentation</td>
  644. <td>No</td>
  645. </tr>
  646. <tr>
  647. <td>packagelistLoc</td>
  648. <td>The location to the directory containing the package-list file for the external
  649. documentation</td>
  650. <td rowspan="2">One of the two if the <var>offline</var> attribute is <q>true</q></td>
  651. </tr>
  652. <tr>
  653. <td>packagelistURL</td>
  654. <td class="left">The URL of the the directory containing the package-list file for the external
  655. documentation</td>
  656. </tr>
  657. <tr>
  658. <td>resolveLink</td>
  659. <td>If the <var>link</var> attribute is a relative file name, Ant will first try to locate the
  660. file relative to the current project's <var>basedir</var> and if it finds a file there use an
  661. absolute URL for the <var>link</var> attribute, otherwise it will pass the file name verbatim
  662. to the <kbd>javadoc</kbd> command.</td>
  663. <td>No; default is <q>false</q></td>
  664. </tr>
  665. </table>
  666. <h4 id="groupelement">group</h4>
  667. <p>Separates packages on the overview page into whatever groups you specify, one group per
  668. table. This performs the same role as the <var>group</var> attribute. You can use either syntax (or
  669. both at once), but with the nested elements you can easily specify multiple occurrences of the
  670. arguments.</p>
  671. <h5>Parameters</h5>
  672. <table class="attr">
  673. <tr>
  674. <th scope="col">Attribute</th>
  675. <th scope="col">Description</th>
  676. <th scope="col">Required</th>
  677. </tr>
  678. <tr>
  679. <td>title</td>
  680. <td>Title of the group</td>
  681. <td>Yes, unless nested <code>&lt;title&gt;</code> given</td>
  682. </tr>
  683. <tr>
  684. <td>packages</td>
  685. <td>List of packages to include in that group. Multiple packages are separated with <q>:</q>.</td>
  686. <td>Yes, unless nested <code>&lt;package&gt;</code>s given</td>
  687. </tr>
  688. </table>
  689. <p>The title may be specified as a nested <code>&lt;title&gt;</code> element with text contents, and
  690. the packages may be listed with nested <code>&lt;package&gt;</code> elements as for the main
  691. task.</p>
  692. <h4>doclet</h4>
  693. <p>The doclet nested element is used to specify
  694. the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/doclet/overview.html"
  695. target="_top">doclet</a> that <kbd>javadoc</kbd> will use to process the input source files. A
  696. number of the standard <kbd>javadoc</kbd> arguments are actually arguments of the standard
  697. doclet. If these are specified in the <code>javadoc</code> task's attributes, they will be passed to
  698. the doclet specified in the <code>&lt;doclet&gt;</code> nested element. Such attributes should only
  699. be specified, therefore, if they can be interpreted by the doclet in use.</p>
  700. <p>If the doclet requires additional parameters, these can be specified
  701. with <code>&lt;param&gt;</code> elements within the <code>&lt;doclet&gt;</code> element. These
  702. parameters are restricted to simple strings. An example usage of the <code>doclet</code> element is
  703. shown below:</p>
  704. <pre>
  705. &lt;javadoc ... &gt;
  706. &lt;doclet name=&quot;theDoclet&quot;
  707. path=&quot;path/to/theDoclet&quot;&gt;
  708. &lt;param name=&quot;-foo&quot; value=&quot;foovalue&quot;/&gt;
  709. &lt;param name=&quot;-bar&quot; value=&quot;barvalue&quot;/&gt;
  710. &lt;/doclet&gt;
  711. &lt;/javadoc&gt;</pre>
  712. <h4 id="tagelement">tag</h4>
  713. <p>If you want to specify a standard tag using a nested <code>tag</code> element because you want to
  714. determine the order the tags are output, you must not set the <var>description</var> attribute for
  715. those tags.</p>
  716. <h5>Parameters</h5>
  717. <table class="attr">
  718. <tr>
  719. <th scope="col">Attribute</th>
  720. <th scope="col">Description</th>
  721. <th scope="col">Required</th>
  722. </tr>
  723. <tr>
  724. <td>name</td>
  725. <td>Name of the tag (e.g. <q>todo</q>)</td>
  726. <td>Yes, unless the <var>dir</var> attribute is specified</td>
  727. </tr>
  728. <tr>
  729. <td>description</td>
  730. <td>Description for tag (e.g. <q>To do:</q>)</td>
  731. <td>
  732. No, the <kbd>javadoc</kbd> executable will pick a default if this is not specified
  733. </td>
  734. </tr>
  735. <tr>
  736. <td>enabled</td>
  737. <td>Whether or not the tag is enabled</td>
  738. <td>No; defaults to <q>true</q></td>
  739. </tr>
  740. <tr>
  741. <td>scope</td>
  742. <td>Scope for the tag&mdash;the elements in which it can be used. This is a comma separated list
  743. of some of the
  744. elements: <q>overview</q>, <q>packages</q>, <q>types</q>, <q>constructors</q>, <q>methods</q>, <q>fields</q>
  745. or the default, <q>all</q>.</td>
  746. <td>No; defaults to <q>all</q></td>
  747. </tr>
  748. <tr>
  749. <td>dir</td>
  750. <td>If this attribute is specified, this element will behave as an
  751. implicit <a href="../Types/fileset.html">fileset</a>. The files included by this fileset
  752. should contain each tag definition on a separate line, as described in
  753. the <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags"
  754. target="_top">Javadoc reference guide</a>:
  755. <pre>ejb.bean:t:XDoclet EJB Tag
  756. todo:a:To Do</pre>
  757. <strong>Note</strong>: The Javadoc reference quide has double quotes around the description
  758. part of the definition. This will not work when used in a file, as the definition is quoted
  759. again when given to the <kbd>javadoc</kbd> program.<br/>
  760. <strong>Note</strong>: If this attribute is specified, all the other attributes in this
  761. element will be ignored.</td>
  762. <td>No</td>
  763. </tr>
  764. </table>
  765. <h4 id="tagletelement">taglet</h4>
  766. <p>The taglet nested element is used to specify
  767. custom <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/overview.html"
  768. target="_top">taglets</a>
  769. beyond <a href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#javadoctags"
  770. target="_top">the default taglets</a>.</p>
  771. <h5>Parameters</h5>
  772. <table class="attr">
  773. <tr>
  774. <th scope="col">Attribute</th>
  775. <th scope="col">Description</th>
  776. <th scope="col">Required</th>
  777. </tr>
  778. <tr>
  779. <td>name</td>
  780. <td>The name of the taglet class
  781. (e.g. <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/taglet/ToDoTaglet.java"
  782. target="_top"><code>com.sun.tools.doclets.ToDoTaglet</code></a>)</td>
  783. <td>Yes</td>
  784. </tr>
  785. <tr>
  786. <td>path</td>
  787. <td>A path specifying the search path for the taglet class (e.g. <samp>/home/taglets</samp>).
  788. The path may also be specified by a nested <code>&lt;path&gt;</code> element</td>
  789. <td>No</td>
  790. </tr>
  791. </table>
  792. <h4>sourcepath, classpath, bootclasspath, modulepath, modulesourcepath</h4>
  793. <p><code>Javadoc</code>'s <i>sourcepath</i>, <i>classpath</i>,
  794. <i>bootclasspath</i>, <i>modulepath</i>, and <i>modulesourcepath</i>
  795. attributes are <a href="../using.html#path">PATH like structure</a>
  796. and can also be set via nested <i>sourcepath</i>,
  797. <i>classpath</i>, <i>bootclasspath</i>, <i>modulepath</i>,
  798. and <i>modulesourcepath</i> elements respectively.</p>
  799. <h4>arg</h4>
  800. <p><em>Since Ant 1.6</em></p>
  801. <p>Use nested <code>&lt;arg&gt;</code> to specify additional arguments.
  802. See <a href="../using.html#arg">Command line arguments</a>.</p>
  803. <h3>Example</h3>
  804. <pre>
  805. &lt;javadoc packagenames=&quot;com.dummy.test.*&quot;
  806. sourcepath=&quot;src&quot;
  807. excludepackagenames=&quot;com.dummy.test.doc-files.*&quot;
  808. defaultexcludes=&quot;yes&quot;
  809. destdir=&quot;docs/api&quot;
  810. author=&quot;true&quot;
  811. version=&quot;true&quot;
  812. use=&quot;true&quot;
  813. windowtitle=&quot;Test API&quot;&gt;
  814. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  815. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  816. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  817. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  818. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  819. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  820. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  821. &lt/javadoc&gt;</pre>
  822. <p>is the same as</p>
  823. <pre>
  824. &lt;javadoc destdir=&quot;docs/api&quot;
  825. author=&quot;true&quot;
  826. version=&quot;true&quot;
  827. use=&quot;true&quot;
  828. windowtitle=&quot;Test API&quot;&gt;
  829. &lt;packageset dir=&quot;src&quot; defaultexcludes=&quot;yes&quot;&gt;
  830. &lt;include name=&quot;com/dummy/test/**&quot;/&gt;
  831. &lt;exclude name=&quot;com/dummy/test/doc-files/**&quot;/&gt;
  832. &lt;/packageset&gt;
  833. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  834. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  835. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  836. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  837. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  838. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  839. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  840. &lt/javadoc&gt;</pre>
  841. <p>or</p>
  842. <pre>
  843. &lt;javadoc destdir=&quot;docs/api&quot;
  844. author=&quot;true&quot;
  845. version=&quot;true&quot;
  846. use=&quot;true&quot;
  847. windowtitle=&quot;Test API&quot;&gt;
  848. &lt;fileset dir=&quot;src&quot; defaultexcludes=&quot;yes&quot;&gt;
  849. &lt;include name=&quot;com/dummy/test/**&quot;/&gt;
  850. &lt;exclude name=&quot;com/dummy/test/doc-files/**&quot;/&gt;
  851. &lt;/fileset&gt;
  852. &lt;doctitle&gt;&lt;![CDATA[&lt;h1&gt;Test&lt;/h1&gt;]]&gt;&lt;/doctitle&gt;
  853. &lt;bottom&gt;&lt;![CDATA[&lt;i&gt;Copyright &amp;#169; 2000 Dummy Corp. All Rights Reserved.&lt;/i&gt;]]&gt;&lt;/bottom&gt;
  854. &lt;tag name=&quot;todo&quot; scope=&quot;all&quot; description=&quot;To do:&quot;/&gt;
  855. &lt;group title=&quot;Group 1 Packages&quot; packages=&quot;com.dummy.test.a*&quot;/&gt;
  856. &lt;group title=&quot;Group 2 Packages&quot; packages=&quot;com.dummy.test.b*:com.dummy.test.c*&quot;/&gt;
  857. &lt;link offline=&quot;true&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot; packagelistLoc=&quot;C:\tmp&quot;/&gt;
  858. &lt;link href=&quot;https://docs.oracle.com/javase/8/docs/api/&quot;/&gt;
  859. &lt/javadoc&gt;</pre>
  860. </body>
  861. </html>