[英]Maven Jaxb plugin error-Required class missing
I am using maven 3.1.0. 我正在使用maven 3.1.0。
I am getting error while trying to build through cmd. 我试图通过cmd构建时遇到错误。
[ERROR] Failed to execute goal org.jvnet.jaxb1.maven2:maven-jaxb1-plugin:1.0-rc9:generate (default) on project Myproject: Execution default of goal org.jvnet.jaxb1.maven2:maven-jaxb1-plugin:1.0-rc9:generate failed: A required class was missing while executing org.jvnet.jaxb1.maven2:maven-jaxb1-plugin:1.0-rc9:generate: com/sun/msv/grammar/Grammar
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jvnet.jaxb1.maven2:maven-jaxb1-plugin:1.0-rc9
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/.m2/repository/org/jvnet/jaxb1/maven2/maven-jaxb1-plugin/1.0-rc9/maven-jaxb1-plugin-1.0-rc9.jar
[ERROR] urls[1] = file:/C:/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] urls[2] = file:/C:/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[3] = file:/C:/.m2/repository/com/sun/xml/bind/jaxb-xjc/1.0.6/jaxb-xjc-1.0.6.jar
[ERROR] urls[4] = file:/C:/.m2/repository/com/sun/xml/bind/jaxb-impl/1.0.6/jaxb-impl-1.0.6.jar
[ERROR] urls[5] = file:/C:/.m2/repository/javax/xml/bind/jaxb-api/1.0/jaxb-api-1.0.jar
[ERROR] urls[6] = file:/C:/.m2/repository/javax/xml/parsers/jaxp-api/1.4/jaxp-api-1.4.jar
[ERROR] urls[7] = file:/C:/.m2/repository/com/sun/xml/parsers/jaxp-ri/1.4/jaxp-ri-1.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: com.sun.msv.grammar.Grammar
I have called maven through command line. 我通过命令行调用了maven。
My POM.xml looks like this: 我的POM.xml看起来像这样:
<plugin>
<groupId>org.jvnet.jaxb1.maven2</groupId>
<artifactId>maven-jaxb1-plugin</artifactId>
<version>1.0-rc9</version>
<executions>
<execution>
<goals>
<goal> generate </goal>
</goals>
</execution>
</executions>
<configuration>
<generatePackage>jaxb1/package</generatePackage>
</configuration>
Disclaimer: I am the author of this plugin, wrote it ages ago. 免责声明:我是这个插件的作者,很久以前写过它。
As @skaffman said, JAXB 1 is ancient, so the maven-jaxb1-plugin
is not actively supported at the moment. 正如@skaffman所说,JAXB 1是古老的,因此目前尚未积极支持
maven-jaxb1-plugin
。 Please use the maven-jaxb2-plugin
instead. 请改用
maven-jaxb2-plugin
。
If there are specific reasons for you to be forced to use maven-jaxb1-plugin
, you'll probably have to fix it yourself. 如果有特殊原因导致您被迫使用
maven-jaxb1-plugin
,则可能必须maven-jaxb1-plugin
修复。 I can move the code to the GitHub and will accept pull requests. 我可以将代码移动到GitHub并接受拉取请求。 This is the best I can do at the moment.
这是我目前能做的最好的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.