FULL PRODUCT VERSION :
* /usr/lib/jvm/java-8-oracle/jre/bin/java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux lenovo-t430u 3.16.0-33-generic #44-Ubuntu SMP Thu Mar 12 12:19:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
* /usr/lib/jvm/java-8-oracle/bin/xjc -version
xjc 2.2.8-b130911.1802
A DESCRIPTION OF THE PROBLEM :
When generating Java-classes with jaxb (xjc) the generated ObjectFactory will contain malformed or invalid javadoc comments. This will result in javadoc warnings and a failure when generating the javadoc with the default configuration from the maven-javadoc-plugin.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Generate java-classes from a xml with xjc and generate javadoc from the generated files.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
0 javadoc warnings
ACTUAL -
Constructing Javadoc information...
Standard Doclet version 1.8.0_60
Building tree for all the packages and classes...
Generating ./src/main/resources/com/example/ObjectFactory.html...
./src/main/java/com/example/ObjectFactory.java:41: warning: no @param for value
public JAXBElement<String> createJaxExample(String value) {
^
./src/main/java/com/example/ObjectFactory.java:41: warning: no @return
public JAXBElement<String> createJaxExample(String value) {
^
Generating ./src/main/resources/com/example/package-frame.html...
Generating ./src/main/resources/com/example/package-summary.html...
Generating ./src/main/resources/com/example/package-tree.html...
Generating ./src/main/resources/constant-values.html...
Building index for all the packages and classes...
Generating ./src/main/resources/overview-tree.html...
Generating ./src/main/resources/index-all.html...
Generating ./src/main/resources/deprecated-list.html...
Building index for all classes...
Generating ./src/main/resources/allclasses-frame.html...
Generating ./src/main/resources/allclasses-noframe.html...
Generating ./src/main/resources/index.html...
Generating ./src/main/resources/help-doc.html...
2 warnings
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
#!/bin/bash
BASE_PATH_FOR_JAVA="./src/main/java/"
BASE_PATH_FOR_JAVADOC="./src/main/resources/"
XSD_CONTENT='<?xml version="1.0"?>\n
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n
<xsd:element name="JaxExample" type="xsd:string"/>\n
</xsd:schema>\n'
XSD_FILE="./demo.xsd"
echo -e ${XSD_CONTENT} > ${XSD_FILE}
mkdir -p ${BASE_PATH_FOR_JAVA}
mkdir -p ${BASE_PATH_FOR_JAVADOC}
xjc -d ${BASE_PATH_FOR_JAVA} -p com.example -xmlschema -no-header ${XSD_FILE}
javadoc -d ${BASE_PATH_FOR_JAVADOC} com.example -sourcepath ${BASE_PATH_FOR_JAVA}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Add missing javadoc comments (manually); need to this step after each generation of the java classes.