maven项目中的链接错误

时间:2014-01-28 11:42:07

标签: java maven sonarqube

我遇到了Maven项目中发生的链接错误。以下是错误详细信息。

[FATAL ERROR] org.sonar.maven.SonarMojo#execute() caused a linkage error (java.lang.LinkageError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.codehaus.sonar:sonar-maven-plugin:3.5.1]
urls[0] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-maven-plugin/3.5.1/sonar-maven-plugin-3.5.1.jar
urls[1] = file:/C:/.m2/repository/org/apache/maven/shared/maven-dependency-tree/1.2/maven-dependency-tree-1.2.jar
urls[2] = file:/C:/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[3] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-batch/3.5.1/sonar-batch-3.5.1.jar
urls[4] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-core/3.5.1/sonar-core-3.5.1.jar
urls[5] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-plugin-api/3.5.1/sonar-plugin-api-3.5.1.jar
urls[6] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-check-api/3.5.1/sonar-check-api-3.5.1.jar
urls[7] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-colorizer/3.5.1/sonar-colorizer-3.5.1.jar
urls[8] = file:/C:/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar
urls[9] = file:/C:/.m2/repository/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
urls[10] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-channel/3.5.1/sonar-channel-3.5.1.jar
urls[11] = file:/C:/.m2/repository/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar
urls[12] = file:/C:/.m2/repository/org/slf4j/slf4j-api/1.6.2/slf4j-api-1.6.2.jar
urls[13] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-duplications/3.5.1/sonar-duplications-3.5.1.jar
urls[14] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-graph/3.5.1/sonar-graph-3.5.1.jar
urls[15] = file:/C:/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
urls[16] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-squid/3.5.1/sonar-squid-3.5.1.jar
urls[17] = file:/C:/.m2/repository/org/picocontainer/picocontainer/2.14.1/picocontainer-2.14.1.jar
urls[18] = file:/C:/.m2/repository/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar
urls[19] = file:/C:/.m2/repository/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar
urls[20] = file:/C:/.m2/repository/org/hibernate/hibernate-commons-annotations/3.1.0.GA/hibernate-commons-annotations-3.1.0.GA.jar
urls[21] = file:/C:/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
urls[22] = file:/C:/.m2/repository/xml-apis/xml-apis/1.3.03/xml-apis-1.3.03.jar
urls[23] = file:/C:/.m2/repository/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar
urls[24] = file:/C:/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
urls[25] = file:/C:/.m2/repository/commons-digester/commons-digester/1.8/commons-digester-1.8.jar
urls[26] = file:/C:/.m2/repository/commons-beanutils/commons-beanutils/1.8.3/commons-beanutils-1.8.3.jar
urls[27] = file:/C:/.m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
urls[28] = file:/C:/.m2/repository/jfree/jfreechart/1.0.9/jfreechart-1.0.9.jar
urls[29] = file:/C:/.m2/repository/jfree/jcommon/1.0.12/jcommon-1.0.12.jar
urls[30] = file:/C:/.m2/repository/org/slf4j/jcl-over-slf4j/1.6.2/jcl-over-slf4j-1.6.2.jar
urls[31] = file:/C:/.m2/repository/org/slf4j/log4j-over-slf4j/1.6.2/log4j-over-slf4j-1.6.2.jar
urls[32] = file:/C:/.m2/repository/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar
urls[33] = file:/C:/.m2/repository/xpp3/xpp3/1.1.3.3/xpp3-1.1.3.3.jar
urls[34] = file:/C:/.m2/repository/org/codehaus/woodstox/woodstox-core-lgpl/4.0.4/woodstox-core-lgpl-4.0.4.jar
urls[35] = file:/C:/.m2/repository/org/codehaus/woodstox/stax2-api/3.0.1/stax2-api-3.0.1.jar
urls[36] = file:/C:/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar
urls[37] = file:/C:/.m2/repository/org/codehaus/staxmate/staxmate/2.0.0/staxmate-2.0.0.jar
urls[38] = file:/C:/.m2/repository/xerces/xercesImpl/2.8.1/xercesImpl-2.8.1.jar
urls[39] = file:/C:/.m2/repository/xalan/xalan/2.7.1/xalan-2.7.1.jar
urls[40] = file:/C:/.m2/repository/xalan/serializer/2.7.1/serializer-2.7.1.jar
urls[41] = file:/C:/.m2/repository/org/mybatis/mybatis/3.1.1/mybatis-3.1.1.jar
urls[42] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-update-center-common/1.5/sonar-update-center-common-1.5.jar
urls[43] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-home/3.5.1/sonar-home-3.5.1.jar
urls[44] = file:/C:/.m2/repository/org/hibernate/hibernate-core/3.3.2.GA/hibernate-core-3.3.2.GA.jar
urls[45] = file:/C:/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
urls[46] = file:/C:/.m2/repository/org/hibernate/hibernate-entitymanager/3.4.0.GA/hibernate-entitymanager-3.4.0.GA.jar
urls[47] = file:/C:/.m2/repository/javassist/javassist/3.4.GA/javassist-3.4.GA.jar
urls[48] = file:/C:/.m2/repository/geronimo-spec/geronimo-spec-jta/1.0-M1/geronimo-spec-jta-1.0-M1.jar
urls[49] = file:/C:/.m2/repository/commons-dbcp/commons-dbcp/1.3/commons-dbcp-1.3.jar
urls[50] = file:/C:/.m2/repository/commons-pool/commons-pool/1.5.4/commons-pool-1.5.4.jar
urls[51] = file:/C:/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.jar
urls[52] = file:/C:/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
urls[53] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-blueprints-core/2.2.0-java5/sonar-blueprints-core-2.2.0-java5.jar
urls[54] = file:/C:/.m2/repository/ch/qos/logback/logback-classic/0.9.30/logback-classic-0.9.30.jar
urls[55] = file:/C:/.m2/repository/ch/qos/logback/logback-core/0.9.30/logback-core-0.9.30.jar
urls[56] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-deprecated/3.5.1/sonar-deprecated-3.5.1.jar
urls[57] = file:/C:/.m2/repository/org/codehaus/sonar/sonar-java-api/3.5.1/sonar-java-api-3.5.1.jar
urls[58] = file:/C:/.m2/repository/com/google/code/gson/gson/2.2.2/gson-2.2.2.jar
urls[59] = file:/C:/.m2/repository/com/h2database/h2/1.3.167/h2-1.3.167.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/D:/Maven/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
[FATAL ERROR] org.codehaus.mojo.sonar.SonarMojo#execute() caused a linkage error (java.lang.LinkageError) and may be out-of-date. Check the realms:
[FATAL ERROR] Plugin realm = app0.child-container[org.codehaus.mojo:sonar-maven-plugin:1.0]
urls[0] = file:/C:/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/1.0/sonar-maven-plugin-1.0.jar
urls[1] = file:/C:/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar
[FATAL ERROR] Container realm = plexus.core
urls[0] = file:/D:/Maven/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] loader constraint violation: loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) previously initiated loading for a different type with name "org/apache/maven/project/MavenProject"

请提供一些建议来解决此错误。

1 个答案:

答案 0 :(得分:0)

我遇到了类似的问题,尝试运行maven插件org.apache.tomcat.maven:tomcat7-maven-plugin:2.1 with maven 3.0.5。 问题可能是您尝试运行的插件与运行它的maven版本不兼容。

它看起来像" org.codehaus.sonar:sonar-maven-plugin:3.5.1"是失败的插件。尝试使用不同版本的插件或不同版本的maven。

您可以使用

检查您的maven版本
mvn --version

并将http://mojo.codehaus.org/sonar-maven-plugin/为您的版本

找到的依赖性和文档进行比较