我一直在用Maven愉快地编译我的项目超过一年,突然之间我收到了标题中提到的错误,即:
无法找到mojo' xjc'插件org.codehaus.mojo中的(或其中一个必需组件):jaxb2-maven-plugin'
.class文件中的版本号错误
下面引用的日志出现在错误消息之前,但不确定它是否相关。据我了解,有一些相互矛盾的版本,但为什么它现在突然出现?
this realm = app0.child-container[org.codehaus.mojo:jaxb2-maven-plugin:1.6] urls[0] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/mojo/jaxb2-maven-plugin/1.6/jaxb2-maven-plugin-1.6.jar urls[1] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/plexus/plexus-utils/3.0.16/plexus-utils-3.0.16.jar urls[2] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-xjc/2.2.7/jaxb-xjc-2.2.7.jar urls[3] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-core/2.2.7/jaxb-core-2.2.7.jar urls[4] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/javax/xml/bind/jaxb-api/2.2.7/jaxb-api-2.2.7.jar urls[5] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/istack/istack-commons-runtime/2.16/istack-commons-runtime-2.16.jar urls[6] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-jxc/2.2.7/jaxb-jxc-2.2.7.jar urls[7] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/bind/jaxb-impl/2.2.7/jaxb-impl-2.2.7.jar urls[8] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/com/sun/xml/fastinfoset/FastInfoset/1.2.12/FastInfoset-1.2.12.jar urls[9] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar urls[10] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar Number of imports: 10 import: org.codehaus.classworlds.Entry@a6c57a42 import: org.codehaus.classworlds.Entry@12f43f3b import: org.codehaus.classworlds.Entry@20025374 import: org.codehaus.classworlds.Entry@f8e44ca4 import: org.codehaus.classworlds.Entry@92758522 import: org.codehaus.classworlds.Entry@ebf2705b import: org.codehaus.classworlds.Entry@bb25e54 import: org.codehaus.classworlds.Entry@bece5185 import: org.codehaus.classworlds.Entry@3fee8e37 import: org.codehaus.classworlds.Entry@3fee19d8 this realm = plexus.core urls[0] = file:/C:/Program Files (x86)/apache-maven-2.2.1/bin/../lib/maven-2.2.1-uber.jar urls[1] = file:/C:/Users/SRAHAINGOSON/.m2/repository/PBIL/org/apache/maven/wagon/wagon-ssh-external/1.0-alpha-5/wagon-ssh-external-1.0-alpha-5.jar Number of imports: 10 import: org.codehaus.classworlds.Entry@a6c57a42 import: org.codehaus.classworlds.Entry@12f43f3b import: org.codehaus.classworlds.Entry@20025374 import: org.codehaus.classworlds.Entry@f8e44ca4 import: org.codehaus.classworlds.Entry@92758522 import: org.codehaus.classworlds.Entry@ebf2705b import: org.codehaus.classworlds.Entry@bb25e54 import: org.codehaus.classworlds.Entry@bece5185 import: org.codehaus.classworlds.Entry@3fee8e37 import: org.codehaus.classworlds.Entry@3fee19d8
pom.xml如下所示:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>src/main/resources/xsd</schemaDirectory>
<schemaIncludes>
<include>*.xsd</include>
</schemaIncludes>
<packageName>fr.extelia.bilan.plugin.cnce.object</packageName>
</configuration>
</plugin>
</plugins>
由于