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