简体   繁体   English

从命令行运行声纳分析时出现链接错误(maven 项目)

[英]Linkage Error on running sonar analysis from command line (maven project)

I am trying to run sonar analysis for my maven project using a remote sonar server.我正在尝试使用远程声纳服务器为我的 maven 项目运行声纳分析。 PFB the versions of sonar and the java that I tried using: PFB 的声纳版本和我尝试使用的 java:

Maven Sonar Plugin : 3.5.0.1254
Java version : 1.7 and 1.8 (tried both)
SonarQube version: 8.3.0

This is the error I get.这是我得到的错误。 I tried updating version of java to 1.8, but I'm still facing an issue Error:我尝试将 java 的版本更新到 1.8,但仍然遇到问题错误:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar  on project <project_name>: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:so
nar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar: java.lang.BootstrapMethodError: java.lang.LinkageError: loading constraint violation when overriding method "okhttp3/EventListener$Factory.create(Lokhttp3/Call;)Lokhttp3/EventListener;" during creation of class "okhttp3/EventListener$$Lambda$123/000000000FBD1C60": loader "java/lang/InternalAnonymousClassL
oader@63d13f09" of class "okhttp3/EventListener$$Lambda$123/000000000FBD1C60" and loader "org/sonar/classloader/ClassRealm@eaecd3ff" of class "okhttp3/EventListener$Factory" have different types for the method signature

Couldn't get any valid references for this issue anywhere.Can anyone help with this?无法在任何地方获得有关此问题的任何有效参考资料。有人可以帮忙吗?

I had similar issue and I found that the issue was because of IBM jdk8 i was using.我有类似的问题,我发现问题是因为我使用的是 IBM jdk8。 So I changed it openjdk8 in env variable JAVA_HOME as well.所以我也在环境变量 JAVA_HOME 中改变了它 openjdk8 。 It works fine now.它现在工作正常。

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

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