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 33 KiB

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