With the change from Java 11 to Java 12, we now see a weird error when generating Javadoc on package-info files containing OSGi version annotations.
The source code is:
@Version("1.3.0")
package org.apache.jackrabbit.oak.commons;
import org.osgi.annotation.versioning.Version;
The error is:
[ERROR] C:\projects\apache\oak\trunk\oak-commons\src\main\java\org\apache\jackrabbit\oak\commons\package-info.java:17: error: unknown tag: Version
[ERROR] @Version("1.3.0")
[ERROR] ^
Is this a regression in Java 12, or is there something wrong in the way the annotations are used, or how Javadoc is invoked (through maven)?
Probably a Javadoc bug, because Javadoc considers the Java Annotation as a Javadoc Tag.
Workaround 1: disable this Javadoc tag
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<tags>
<tag>
<name>Version</name>
<placement>X</placement>
</tag>
</tags>
</configuration>
</plugin>
Workaround 2: add an empty Javadoc block in front of every annotation
/** */@Version("1.3.0")
package org.apache.jackrabbit.oak.commons;