" HTTP://annox.dev.java.net"自定义需要“-Xannotate”开关 [英] "http://annox.dev.java.net" customizations require the "-Xannotate" switch

查看:109
本文介绍了" HTTP://annox.dev.java.net"自定义需要“-Xannotate”开关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过hyperjaxb运行一个真正的架构。我已经使用jaxb重复测试了模式,并且jaxb每次都正确地导入模式。但是,当我尝试使用hyperjaxb从同一模式生成带有hibernate-annotated的java类时,我收到以下错误:

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.

我已用Google搜索此错误消息并阅读有关它的其他帖子,但未找到任何干净的说明解决它。我找到的最接近的是这篇文章,其中说annox插件由-Xannotate命令行参数激活。

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.

我读过这个链接 ,但是将以下内容添加到xsd文件并没有消除错误,可能是因为 xsd 不使用 jaxb 前缀任何地方。

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"

我上传了一个包含所有相关材料的zip文件,以便快速重现问题到此链接。它是项目的zip文件,包括预期的架构。要重现问题,只需将命令行导航到解压缩项目的根目录,然后键入 mvn clean install 即可重现错误。

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.

如何解决此错误?

我已经尝试在pom.xml中添加以下插件配置,但到目前为止还没有成功。

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>  






第二次编辑:



我将@lexicore的建议添加到 pom.xml ,但结果是空指针异常,您可以通过单击此链接阅读。为了促进其他人更容易使用 hyperjaxb ,我将包含完整的当前 pom.xml 在此链接。这个修改后的 pom.xml 以及上面的zip文件足以在几分钟内重现问题。这是配置问题还是错误?


SECOND

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?

推荐答案

你应该删除这个插件< 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>

这篇关于&QUOT; HTTP://annox.dev.java.net&quot;自定义需要“-Xannotate”开关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆