0

I'm trying to generate XSD files from my java project with the jaxb2-maven-plugin. When doing this i get a syntax error referencing pieces of code where there are java notations like @Nonnull or @Nullable.

Im using the jaxb2 maven plugin to generate XSD files from Java files. I declare my plugin like this:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>jaxb2-maven-plugin</artifactId>
  <version>3.1.0</version>
  <executions>
    <execution>
      <id>schemagen</id>
      <goals>
        <goal>schemagen</goal>
      </goals>
    </execution>
  </executions>
</plugin>

I get this error:

Execution schemagen of goal org.codehaus.mojo:jaxb2-maven-plugin:3.1.0:schemagen failed: syntax error @[51,4] in file:/D:/project/src/main/java/api/ConfigurableIO.java (org.codehaus.mojo:jaxb2-maven-plugin:3.1.0:schemagen:schemagen:generate-resources)

The piece of code at referenced in the error:

  <@Nonnull E extends Entity>
  EntityLink<E> getEntityLink();

I can exclude this file and this will result in a syntax error on a different file always with a @Nonnull or @Nullable annotation.

I tried to annotate the specified attribute with @XmlTransient but without succes.

Is there a way to configure the plugin so that it will ignore these annotations, or work with them?

kasder
  • 11
  • 2

0 Answers0