尝试使用gradle版本2.3将声纳 - 跑步者从2.4升级到2.5
这是build.gradle的片段:
classpath 'org.codehaus.sonar.runner:sonar-runner-dist:2.5'
我使用以下内容上传sonar-runner-dist-2.5.jar
<dependency>
<groupId>org.codehaus.sonar.runner</groupId>
<artifactId>sonar-runner-dist</artifactId>
<version>2.5</version>
</dependency>
到nexus
但在运行时出错
gradle build :noINT :Backend:TestServices:sonarRunner
错误:
[system.err] Error: Could not find or load main class org.sonar.runner.Main
另外,我的声纳运行器2.4工作,具有以下配置:
组:org.codehaus.sonar.runner 神器:声纳 - 跑步者 版本:2.4 扩展名:jar XML:
<dependency>
<groupId>org.codehaus.sonar.runner</groupId>
<artifactId>sonar-runner-dist</artifactId>
<version>2.4</version>
</dependency>
以下是摘要:
我正在尝试使用SonarQube版本5.3,使用声纳版本2.5版
首先我对sonarQube 5.2运行声纳 - 跑步者2.4,这种方法很好,但是当我通过本地nexus repo升级到声纳 - 跑步者2.5并将其运行到sonarQube 5.3时
我的构建失败并且异常:
16:31:05.880 [ERROR] [system.err] Error: Could not find or load main class org.sonar.runner.Main
16:31:05.887 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
16:31:05.887 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/usr/lib/jvm/jdk1.7.0_80/bin/java'' finished with exit value 1 (state: FAILED)
16:31:05.887 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':Backend:E2Services:sonarRunner'
16:31:05.887 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :Backend:E2Services:sonarRunner FAILED
16:31:05.888 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :Backend:E2Services:sonarRunner (Thread[Daemon worker Thread 3,5,main]) completed. Took 0.544 secs.
16:31:05.888 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 3,5,main]] finished, busy: 10 mins 55.24 secs, idle: 0.025 secs
16:31:05.888 [ERROR] [org.gradle.BuildExceptionReporter]
16:31:05.889 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:31:05.889 [ERROR] [org.gradle.BuildExceptionReporter]
16:31:05.889 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
16:31:05.889 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':Backend:E2Services:sonarRunner'.
答案 0 :(得分:0)
切换到Sonar Scanner 1.2,问题已解决。