当前位置:  开发笔记 > 编程语言 > 正文

org/sonar/api/utils/SonarException:不支持的major.minor版本51.0

如何解决《org/sonar/api/utils/SonarException:不支持的major.minor版本51.0》经验,为你挑选了1个好方法。

在从3.3.2升级到Sonarqube 5.1.2之后,我需要使用jdk 1.6构建的项目的maven构建失败了:

build   03-Dec-2015 19:33:10    [INFO] ------------------------------------------------------------------------
build   03-Dec-2015 19:33:10    [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project my_project: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar failed: An API incompatibility was encountered while executing org.codehaus.mojo:sonar-maven-plugin:2.6:sonar: java.lang.UnsupportedClassVersionError: org/sonar/api/utils/SonarException : Unsupported major.minor version 51.0
build   03-Dec-2015 19:33:10    [ERROR] -----------------------------------------------------
build   03-Dec-2015 19:33:10    [ERROR] realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:2.6
build   03-Dec-2015 19:33:10    [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
build   03-Dec-2015 19:33:10    [ERROR] urls[0] = file:/tmp/org/codehaus/mojo/sonar-maven-plugin/2.6/sonar-maven-plugin-2.6.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[1] = file:/tmp/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[2] = file:/tmp/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[3] = file:/tmp/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[4] = file:/tmp/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[5] = file:/tmp/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[6] = file:/tmp/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[7] = file:/tmp/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[8] = file:/tmp/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[9] = file:/tmp/org/codehaus/sonar/runner/sonar-runner-api/2.4/sonar-runner-api-2.4.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[10] = file:/tmp/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[11] = file:/tmp/com/google/guava/guava/10.0.1/guava-10.0.1.jar
build   03-Dec-2015 19:33:10    [ERROR] urls[12] = file:/tmp/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
build   03-Dec-2015 19:33:10    [ERROR] Number of foreign imports: 1
build   03-Dec-2015 19:33:10    [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
build   03-Dec-2015 19:33:10    [ERROR] 
build   03-Dec-2015 19:33:10    [ERROR] -----------------------------------------------------
build   03-Dec-2015 19:33:10    [ERROR] -> [Help 1]

似乎是一个兼容性问题,任何想法?指向旧的声纳它仍然工作正常,指向新的声纳,我明白了.

谢谢,罗伯托



1> Fabrice - So..:

您可以在"要求"页面或"SonarQube 5.0升级指南"中阅读,至少需要Java 7才能运行SonarQube分析.

您始终可以使用Java 6构建(编译,测试等)您的项目,但是您需要将SonarQube分析配置为使用Java 7或更高版本.

推荐阅读
郑小蒜9299_941611_G
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有