运行sonar-scanner时出错:java.lang.NoClassDefFoundError:org / sonar / batch / bootstrapper / LogOutput $ Level

时间:2018-03-27 14:32:53

标签: sonarqube sonar-runner sonarqube-scan

sonar-scanner -X
19:49:25.192 INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/3.1.0.1141/libexec/conf/sonar-scanner.properties

19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141
19:49:25.212 INFO: Java 1.8.0_131 Oracle Corporation (64-bit)
19:49:25.212 INFO: Mac OS X 10.13 x86_64
19:49:25.363 DEBUG: keyStore is : 
19:49:25.363 DEBUG: keyStore type is : jks
19:49:25.363 DEBUG: keyStore provider is : 


19:49:25.589 DEBUG: Create isolated classloader...
19:49:25.597 DEBUG: Start temp cleaning...
19:49:25.607 DEBUG: Temp cleaning done
19:49:25.607 DEBUG: Execution getVersion
  • 列出项目

    19:49:25.623 INFO:执行失败 19:49:25.623 INFO:------------------------------------------- ----------------------------- 19:49:25.623信息:总时间:0.452秒 19:49:25.648信息:最终记忆:4M / 123M 19:49:25.648 INFO:------------------------------------------- ----------------------------- 19:49:25.648错误:SonarQube扫描仪执行期间出错 java.lang.BootstrapMethodError:java.lang.NoClassDefFoundError:org / sonar / batch / bootstrapper / LogOutput $ Level     at org.sonarsource.scanner.api.internal.batch.DefaultBatchFactory.createBatch(DefaultBatchFactory.java:35)     在org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     在org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)     在com.sun.proxy。$ Proxy0.execute(未知来源)     在org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171)     在org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128)     在org.sonarsource.scanner.cli.Main.execute(Main.java:111)     在org.sonarsource.scanner.cli.Main.execute(Main.java:75)     在org.sonarsource.scanner.cli.Main.main(Main.java:61) 引起:java.lang.NoClassDefFoundError:org / sonar / batch / bootstrapper / LogOutput $ Level     ......还有13个 引起:java.lang.ClassNotFoundException:org.sonar.batch.bootstrapper.LogOutput $ Level     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)     at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ......还有13个

1 个答案:

答案 0 :(得分:2)

SonarQube Scanner 3.1.0.1141(19:49:25.211 INFO: SonarQube Scanner 3.1.0.1141)与SonarQube 5.6+(LTS)(read more here)兼容。您有SonarQube服务器5.0.1(19:49:25.610 INFO: SonarQube server 5.0.1),因此这两个工具不兼容(在5.2)中添加了类org/sonar/batch/bootstrapper/LogOutput$Level

你可以:

  • 使用旧版本的扫描仪(download声纳 - 跑步机2.4 - 阅读runner vs scanner
  • 将SonarQube服务器升级至至少5.6