简体   繁体   English

Maven项目中的链接错误

[英]Linkage Error in maven project

I have came across a Linkage Error occurred in a Maven project. 我遇到了Maven项目中发生的链接错误。 Below are the error details. 下面是错误的详细信息。

[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"

Please give some suggesstions to solve this error. 请提出一些建议以解决此错误。

I just ran into a similar problem trying to run the maven plugin org.apache.tomcat.maven:tomcat7-maven-plugin:2.1 with maven 3.0.5. 我只是在尝试使用Maven 3.0.5运行Maven插件org.apache.tomcat.maven:tomcat7-maven-plugin:2.1时遇到了类似的问题。 Its likely that the issue is the plugin that you are trying to run is not compatible with the version of maven that is running it. 问题很可能是您尝试运行的插件与运行它的Maven版本不兼容。

It looks like "org.codehaus.sonar:sonar-maven-plugin:3.5.1" is the plugin that is failing. 看起来“ org.codehaus.sonar:sonar-maven-plugin:3.5.1”是失败的插件。 Try either using a different version of the plugin or a different version of maven. 尝试使用其他版本的插件或其他版本的maven。

You can check your version of maven using 您可以使用以下方法检查您的Maven版本:

mvn --version

and compare that verses the dependicenies and documentation found at http://mojo.codehaus.org/sonar-maven-plugin/ for your version 并比较您在http://mojo.codehaus.org/sonar-maven-plugin/上找到的依赖版本和文档的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM