在不同的机器上运行声纳扫描仪和声纳服务器时出错

时间:2016-04-22 09:24:39

标签: ios objective-c sonarqube sonarqube-scan

我在windows机器上安装了sonarqube服务器。它通过声纳扫描仪(同一台机器上的声纳扫描仪)成功地为.net / php项目工作。

但是对于iOS项目,我正在使用目标C的免费插件。为此我使用MAC机器并尝试从mac运行声纳扫描仪,我还在sonar-runner.properties中配置了服务器主机URL 。

版本详情如下: Searver:sonarqube-5.4 Objective-c版本:sonar-objective-c-plugin-0.4.0 xcode:6和最新的xctool OCLint最新版本

我收到了以下错误。

ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Unable to register extension org.sonar.plugins.objectivec.core.ObjectiveCSourceImporter
    at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:241)
    at org.sonar.batch.bootstrap.ExtensionInstaller.doInstall(ExtensionInstaller.java:68)
    at org.sonar.batch.bootstrap.ExtensionInstaller.install(ExtensionInstaller.java:49)
    at org.sonar.batch.scan.ModuleScanContainer.addExtensions(ModuleScanContainer.java:172)
    at org.sonar.batch.scan.ModuleScanContainer.doBeforeStart(ModuleScanContainer.java:92)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:133)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
    at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:264)
    at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:259)
    at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:249)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.batch.scan.ProjectScanContainer.startComponents(ProjectScanContainer.java:127)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
    at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55)
    at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:120)
    at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
    at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:67)
    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:483)
    at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:274)
    at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:165)
    at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:152)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:118)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:80)
    at org.sonarsource.scanner.cli.Main.main(Main.java:66)
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSystem
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
    at java.lang.Class.getDeclaredMethods(Class.java:1967)
    at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection.java:203)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotated(AdaptingInjection.java:200)
    at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectionAdapter(AdaptingInjection.java:171)
    at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:70)
    at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
    at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
    at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
    at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
    at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
    at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:239)
    ... 31 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.resources.ProjectFileSystem
    at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
    ... 45 more
ERROR: 
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
+ returnValue=1
+ set +x

1 个答案:

答案 0 :(得分:1)

sonar-objective-c-plugin 0.4.0与SonarQube 5.3 +不兼容。

插件跟踪问题系统有一个故障单:java.lang.NoClassDefFoundError: org/sonar/api/resources/ProjectFileSystem

作者准备了一个应该解决这个问题的快照:https://drive.google.com/file/d/0B8TMhTccVIJ-d1lvN3dxb1M4a3c/view