When running 'maven install', I get the following..
[INFO] [javadoc:javadoc {execution: default}] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] An error has occurred in JavaDocs report generation:Exit code: 1 - java.lang.NullPointerException at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:180) at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageList(PackageUseWriter.java:124) at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUse(PackageUseWriter.java:110) at com.sun.tools.doclets.formats.html.PackageUseWriter.generatePackageUseFile(PackageUseWriter.java:99) at com.sun.tools.doclets.formats.html.PackageUseWriter.generate(PackageUseWriter.java:78) at com.sun.tools.doclets.formats.html.ClassUseWriter.generate(ClassUseWriter.java:116) at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:92) at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122) 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:269) at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143) 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: /home/fsl/jdk1.6.0_12/jre/../bin/javadoc @options @packages @argfile
What am I doing wrong?
You need to call mvn javadoc:fix to fix main Java source files (i.e. inside src/main/java directory) or mvn javadoc:test-fix to fix test Java source files (i.e. inside src/test/java directory).
In Netbeans, you can instruct Maven to check javadoc on every project open : Tools | Options | Java icon | Maven tab | Dependencies category | Check Javadoc drop down set to Every Project Open . Close and reopen Netbeans and you will see Maven download javadocs in the status bar.
The Javadoc generation can be skipped by setting the property maven. javadoc. skip to true [1], i.e.
javadoc:javadoc generates the Javadoc files for the project. It executes the standard Javadoc tool and supports the parameters used by the tool. javadoc:test-javadoc generates the test Javadoc files for the project. It executes the standard Javadoc tool and supports the parameters used by the tool.
Also, if you have:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default-cli) on project coolproject-api: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - javadoc: warning - No source files for package org.coolproject.api
[ERROR] javadoc: warning - No source files for package org.coolproject.api
[ERROR] javadoc: warning - No source files for package org.coolproject.api.listeners
[ERROR] javadoc: error - No public or protected classes found to document.
Java compiler understands sources directories with package-style names like:
coolproject-api/java/org.coolproject.api/
and there are no problems with it, but maven-javadoc-plugin doesn't. So try to change your "physical" packages layout to:
coolproject-api/java/org/coolproject/api/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With