corretto-11 icon indicating copy to clipboard operation
corretto-11 copied to clipboard

Javadoc does not handle annotations in package-info.java correctly

Open Aerixs opened this issue 3 years ago • 0 comments

In 11.0.17.8.1 the OpenJDK version was updated. Javadoc in this OpenJDK version fails to resolve package level annotations in package-info.java. See also: https://bugs.openjdk.org/browse/JDK-8295850.

I've attached a simple Spring Boot Sample project where I added the situation where this error occurs. Using jaxb2 to generate example classes, which creates a package-info.java file.

demo-with-javadoc-jaxb2.zip

On Amazon Corretto 11.0.17 ./mvnw verify gives the following error:

[ERROR] /Users/<user>/Downloads/demo/target/generated-sources/xjc/com/example/demo/dto/package-info.java:8: error: unknown tag: javax.xml.bind.annotation.XmlSchema
[ERROR] @javax.xml.bind.annotation.XmlSchema(namespace = "http://localhost/WebService/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
[ERROR] ^
[ERROR] 
[ERROR] Command line was: /Users/<user>/.sdkman/candidates/java/11.0.17-amzn/bin/javadoc @options @packages

On Amazon Corretto 11.0.16 this command does not fail.

Aerixs avatar Nov 09 '22 14:11 Aerixs