1

I get the following error message:

Error:  Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.3.2:
jar (attach-javadocs) on project: 
MavenReportException: Error while generating Javadoc: 
Error:  Exit code: 1 - ...../package-info.java:1: error: unknown tag: XmlSchema

Everywhere else I use the @XmlSchema annotation it does not complain and the Eclipse IDE has no problems with compiling it either. The dependencies are listed in pom.xml.

    <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>4.0.0-RC3</version>
    </dependency>

The pacakge-info.java is

@XmlSchema(
    elementFormDefault = XmlNsForm.QUALIFIED,
    xmlns = {
            @XmlNs(prefix="edmx", namespaceURI="http://docs.oasis-open.org/odata/ns/edmx"),
            @XmlNs(prefix="", namespaceURI="http://docs.oasis-open.org/odata/ns/edm")
    },
    namespace = "http://docs.oasis-open.org/odata/ns/edm"
)

package io.rtdi.appcontainer.odata.entity.metadata;

import jakarta.xml.bind.annotation.XmlNs;
import jakarta.xml.bind.annotation.XmlNsForm;
import jakarta.xml.bind.annotation.XmlSchema;
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.3.2</version>
    <configuration>
        <source>11</source>
        <detectJavaApiLink>false</detectJavaApiLink>
    </configuration>
    <executions>
        <execution>
            <id>attach-javadocs</id>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Any thoughts why that might fail with openjdk 12.0.2 as builder in github?

Werner Daehn
  • 577
  • 6
  • 16
  • Question: `unknown tag: XmlSchema` ? Why adding a tag `@XmlSchema` to package-info file?Does that deserve any purpose? – khmarbaise Mar 31 '22 at 14:54
  • @khmarbaise For specific combinations of namespaces it is required to add a XmlSchema at package level. https://www.eclipse.org/eclipselink/documentation/2.6/moxy/type_level002.htm – Werner Daehn Apr 01 '22 at 15:42
  • This is a duplicate of [Weird javadoc error (with jdk12) for OSGi version annotation](https://stackoverflow.com/questions/55906161/weird-javadoc-error-with-jdk12-for-osgi-version-annotation) It fails with JDK 12 because there was a bug in javadoc in JDK 12: https://bugs.openjdk.org/browse/JDK-8222091 – Liam Miller-Cushon Oct 24 '22 at 19:05

0 Answers0