我正在使用maven 3.1.0。Maven Jaxb插件錯誤 - 所需類缺失
我在嘗試通過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
我已經通過命令行調用了maven。
我的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>
您可以顯示完整的錯誤輸出而不是隻顯示摘錄嗎?你怎麼稱呼maven?在命令行上還是在Eclipse/IDE中? – khmarbaise 2015-02-12 05:45:31
jaxb1是古老的 - 沒有理由再使用它。 – skaffman 2015-02-12 07:15:48
粘貼完整錯誤輸出 – Minnie 2015-02-12 07:15:58