是否可以让 maven-jaxb-schemagen-plugin 与 Java 7 一起使用?
当我尝试将 maven-jaxb-schemagen-plugin
与 java 7 一起使用时,
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
出现错误:
[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactory
似乎 AnnotationProcessorFactory
在 Java 7 中被删除/弃用?是否可以使用此插件让 jaxb schemagen 工作?使用 JDK 7 时是否有其他方法可以从 JAXB 源代码生成模式?
When I try to use maven-jaxb-schemagen-plugin
with java 7
<groupId>com.sun.tools.jxc.maven2</groupId>
<artifactId>maven-jaxb-schemagen-plugin</artifactId>
<version>1.2</version>
I get an error:
[ERROR] Failed to execute goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate (default) on project TopologyProvisionerDom: Execution default of goal com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate failed: A required class was missing while executing com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.2:generate: com/sun/mirror/apt/AnnotationProcessorFactory
It seems like the AnnotationProcessorFactory
is being removed/deprecated in Java 7? Is it possible to get jaxb schemagen to work using this plugin? Is there an alternative approach to get schema generation from the JAXB source code when using JDK 7?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过使用
org.codehaus.mojo:jaxb2-maven-plugin
代替?Have you tried using the
org.codehaus.mojo:jaxb2-maven-plugin
instead?它的工作原理如下(将此配置文件添加到您的
pom.xml
中):This is how it works (add this profile to your
pom.xml
):不确定是否有人再听这个线程,但是,嘿……
我使用了
transformSchemas
选项,例如Cheers
-m。
Not sure anyone is listening to this thread anymore but, what the hey...
I used the
transformSchemas
option e.g.cheers
-m.