javajaxbxsdhyperjaxbannox

"http://annox.dev.java.net" customizations require the "-Xannotate" switch


I am trying to run a real schema through hyperjaxb. I have tested the schema repeatedly using jaxb, and jaxb imports the schema correctly every time. However, when I try to get hyperjaxb to generate hibernate-annotated java classes from the same schema, I get the following error:

[ERROR] Error while parsing schema(s).Location [ file:/C:/path/to/src/main/resources/schema.xsd{4,32}].
org.xml.sax.SAXParseException; systemId: file:/C:/path/to/src/main/resources/schema.xsd;  
lineNumber: 4; columnNumber: 32; 
Using "http://annox.dev.java.net" customizations requires the "-Xannotate" switch 
to enable this plug-in.

I have googled this error message and read other postings about it, but have not found any clean instructions for resolving it. The closest I have found is this article, which says that the annox plugin is activated by the -Xannotate command-line argument.

I read this link, but adding the following to the xsd file did not eliminate the error, probably because the xsd does not use the jaxb prefix anywhere.

xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.1" 
xmlns:annox="http://annox.dev.java.net" 
jaxb:extensionBindingPrefixes="annox"

I have uploaded a zip file containing all the relevant materials to quickly reproduce the problem to this link. It is a zip file of the project including the intended schema. All you have to do to reproduce the problem is navigate the command line to the root directory of the unzipped project and type mvn clean install to reproduce the error.

How can I resolve this error?


EDIT:

I have experimented with adding the following to plugin configuration in pom.xml, but so far have not had success.

<args>
    <arg>-Xannotate</arg>
</args>  

SECOND EDIT:

I added @lexicore 's suggestions to the pom.xml, but the result is a null pointer exception, which you can read by clicking on this link. To promote easier use of hyperjaxb by others, I am including the full current pom.xml at this link. Together, this revised pom.xml and the above zip file are enough to recreate the problem in a few minutes. Is this a configuration problem or a bug?


Solution

  • You should remove this plugin <artifactId>maven-hyperjaxb3-plugin</artifactId>

            <plugin>
                <groupId>org.jvnet.hyperjaxb3</groupId>
                <artifactId>maven-hyperjaxb3-plugin</artifactId>
                <version>0.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <extension>true</extension>
                    <roundtripTestClassName>RoundtripTest</roundtripTestClassName>
                </configuration>
            </plugin>