简体   繁体   English

Maven Jaxb插件错误-缺少必需的类

[英]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.

相关问题 从xsd生成maven-jaxb2-plugin类(版本错误) - maven-jaxb2-plugin class generation from xsd (Version Error) 执行 org.apache.maven.plugins:maven-war-plugin:2.1.1:war 时缺少必需的类 - A required class was missing while executing org.apache.maven.plugins:maven-war-plugin:2.1.1:war A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar - A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:3.2.0:jar 在jaxb2-maven-plugin中使用jaxb:class和annox:annotate? - Use jaxb:class and annox:annotate together in jaxb2-maven-plugin? Maven 插件失败,缺少 class javax/xml/bind/JAXBException,即使在添加 jaxb-core、jaxb-api、jaxb-impl 依赖项之后也是如此 - Maven Plugin fails with missing class javax/xml/bind/JAXBException even after adding jaxb-core, jaxb-api, jaxb-impl dependencies “ org.jvnet.jaxb2.maven2” Maven插件在Eclipse中显示错误 - “org.jvnet.jaxb2.maven2” maven plugin showed error in eclipse 执行com.google.appengine时,缺少必需的类:appengine-maven-plugin:1.9.4 - A required class was missing while executing com.google.appengine:appengine-maven-plugin:1.9.4 Maven的间歇性问题,缺少必需的类 - Intermittent issue with Maven with required class missing Maven 阴影 IllegalStateException - 缺少必需的 class 信息 - Maven shade IllegalStateException - Required class information is missing Maven-jaxb2-plugin未将注释添加到类级别 - Annotation not added to class level by maven-jaxb2-plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM