...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Javadoc report generation:Exit code: 1 - java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(ParseUtil.java:189)
at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:953)
at sun.misc.URLClassPath$3.run(URLClassPath.java:326)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:320)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:297)
at sun.misc.URLClassPath.findResource(URLClassPath.java:144)
at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
at java.lang.ClassLoader.getResource(ClassLoader.java:977)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:89)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:72)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:79)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:159)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
Command line was:C:\Java\jdk1.6.0_03\jre\..\bin\javadoc.exe @options @packages
...
These argument files are generated at runtime depending the Javadoc Plugin configuration and are deleted
when the Javadoc Plugin ended.
To preserve them, just add <debug>true</debug> in your Javadoc Plugin configuration or just call
mvn javadoc:javadoc -Ddebug=true or mvn javadoc:javadoc -X.
In this case, an additional script file (javadoc.bat (or .sh) will be created in the apidocs
directory.
[top]
How to add additional Javadoc parameters?
You could need to add more Javadoc parameters to be process by the Javadoc Tool (i.e. for doclet).
For this, you should use the <additionalOptions/> parameter in your Javadoc Plugin configuration.
[top]
How to add additional Javadoc options?
You could need to add more J options (i.e. runtime system java options that runs Javadoc tool like -J-Xss)
to be process by the Javadoc Tool. For this, you should use the <additionalJOption/> parameter
in your Javadoc Plugin configuration.
The Javadoc Plugin calls the Javadoc tool with J options, i.e.:
CLASSPATH=.;C:\Java\jdk1.6.0_03\jre\lib\ext\QTJava.zip;%JAVAHOME%
[top]
How to increase Javadoc heap size?
If you need to increase the Javadoc heap size, you should use the <minmemory/> and
<maxmemory/> parameters in your Javadoc Plugin configuration. For instance:
Note: The memory unit depends on the JVM used. The units supported could be: k,
kb, m, mb, g, gb, t,
tb. If no unit specified, the default unit is m.
[top]
How to add proxy support?
To specify a proxy in the Javadoc tool, you need to configure an active proxy in your
${user.home}/.m2/settings.xml, similar to:
set CLASSPATH=C:\Java\jdk1.6.0_03\jre\lib\ext\QTJava.zip
With this, the Javadoc tool will be called with networking J options, i.e.:
${project.reporting.outputDirectory}/apidocs/javadoc.exe(or .sh) \
-J-Dhttp.proxySet=true \
-J-Dhttp.proxyHost=proxy.somewhere.com \
-J-Dhttp.proxyPort=3128 \
-J-Dhttp.nonProxyHosts="java.sun.com|*.somewhere.com" \
-J-Dhttp.proxyUser="foo" \
-J-Dhttp.proxyPassword="bar" \
@options \
@packages | @argfile
Note: If your proxy needs more JVM
networking properties
(like NTLM), you could always add JVM options using the <additionalJOption/> parameter
in your Javadoc Plugin configuration, i.e.:
<configuration>
<additionalJOption>-J-Dhttp.auth.ntlm.domain=MYDOMAIN</additionalJOption>
...
</configuration>
[top]
How to have less output?
Just set the <quiet/> parameter to true in your Javadoc Plugin configuration.
[top]
How to remove test Javadocs report?
You need to configure the <reportSets/> parameter. Read the
Selective Javadocs Reports part for more information.
[top]
How to deploy Javadoc jar file?
Basically, you need to call mvn clean javadoc:jar deploy. If you want to include the javadoc jar
in a release process, you need to attach it in the release profile, for instance:
<project>
...
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
...
</profiles>
...
</project>
To deploy the Javadoc jar on a given Maven repository, you could call:
mvn deploy:deploy-file \
-DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dfile=<path-to-file> \
-Dpackaging=jar \
-DrepositoryId=<repository-id> \
-Durl=dav:http://www.myrepository.com/m2 \
-Dclassifier=javadoc
[top]
How to include additional source code directories in aggregate mode?
If you use the Javadoc report in the aggregate mode, i.e. using the aggregate parameter, and if the
Javadoc report does not include additional source code directories defined using the
build-helper:add-source goal,
you need to use the javadoc:aggregate goal instead of javadoc:javadoc goal. Read the
Aggregating Javadocs for Multi-Projects part for more information.
[top]
How to use <links/> option in Standard Doclet?
You need to configure the <links/> parameter. Also, you
should correctly write references in your Javadoc, i.e.:
- @see MyMojo or {@link MyMojo} will NOT work.
- @see com.mycompany.plugin.myplugin.MyMojo or {@link com.mycompany.myplugin.MyMojo}
will work.
[top]
How to add cross reference link to internal-external projects?
Please refer to Links configuration page.
[top]
On Windows with Sun JDK, why javadoc:javadoc goal blows up due to an IllegalArgumentException in sun.net.www.ParseUtil.decode()?
You are on Windows XP with Sun JDK 5 or JDK 6 freshly installed, and when you run mvn javadoc:javadoc,
you are stick by an sun.net.www.ParseUtil.decode() exception like this
one.
...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An error has occurred in Javadoc report generation:Exit code: 1 - java.lang.IllegalArgumentException
at sun.net.www.ParseUtil.decode(ParseUtil.java:189)
at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:953)
at sun.misc.URLClassPath$3.run(URLClassPath.java:326)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:320)
at sun.misc.URLClassPath.getLoader(URLClassPath.java:297)
at sun.misc.URLClassPath.findResource(URLClassPath.java:144)
at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
at java.lang.ClassLoader.getResource(ClassLoader.java:977)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport.java:89)
at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:250)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:223)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:128)
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:72)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML(LayoutParser.java:79)
at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(ClassBuilder.java:108)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:159)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
Command line was:C:\Java\jdk1.6.0_03\jre\..\bin\javadoc.exe @options @packages
...
Your CLASSPATH environement variable is probably corrupted, i.e. something like:
CLASSPATH=.;C:\Java\jdk1.6.0_03\jre\lib\ext\QTJava.zip;%JAVAHOME%
with %JAVAHOME% not a valid environment variable.
To resolve it, just reset the CLASSPATH environement variable, i.e.:
or set a new CLASSPATH environement variable, i.e.:
set CLASSPATH=C:\Java\jdk1.6.0_03\jre\lib\ext\QTJava.zip
or fix the wrong environment variable.
Refer you to
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6219854
from Sun for more details.
[top]
What are the values of <encoding/>, <docencoding/> and <charset/> parameters?
By default, these parameters have the following values:
- <encoding/>
- Value of ${project.build.sourceEncoding} property or the value of the
file.encoding system property if not specified.
- <docencoding/>
- Value of ${project.reporting.outputEncoding} property or UTF-8 if not specified.
- <charset/>
- Value of docencoding parameter if not specified.
[top]
Why do I get errors when using links under Java 8?
Due to a bug in JDK 8
you need at least Java 8u20 for this to work. See
MJAVADOC-393
for more info.
[top]