2014-10-10 60 views
4

我在使用gradle sonar-runner插件在本地運行的sonarqube發佈統計信息時遇到問題。未能發佈到sonarqube

apply plugin: 'sonar-runner' 

堆棧跟蹤表明,它不能從服務器下載庫,並提供了以下網址:http://localhost:9000/batch/。當我將它輸入URL,它返回:

{"errors":[{"msg":"Bad filename: "}]} 

我使用從搖籃邊的所有默認配置,它以前在版本3.7的工作。

聲納的版本是4.5

搖籃版本1.12

堆棧跟蹤是:

* Exception is: 
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarRunner'. 
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) 
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) 
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) 
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) 
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) 
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42) 
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) 
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289) 
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) 
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63) 
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51) 
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23) 
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86) 
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29) 
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) 
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67) 
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) 
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) 
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) 
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166) 
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113) 
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) 
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64) 
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) 
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) 
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) 
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) 
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) 
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) 
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201) 
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174) 
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) 
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) 
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) 
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) 
    at org.gradle.launcher.Main.doAction(Main.java:46) 
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) 
    at org.gradle.launcher.Main.main(Main.java:37) 
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) 
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) 
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23) 
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) 
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) 
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56) 
Caused by: java.lang.IllegalStateException: Fail to download libraries from server 
    at org.sonar.runner.Bootstrapper.downloadBatchFiles(Bootstrapper.java:166) 
    at org.sonar.runner.Bootstrapper.createClassLoader(Bootstrapper.java:89) 
    at org.sonar.runner.Runner.createClassLoader(Runner.java:229) 
    at org.sonar.runner.Runner.execute(Runner.java:151) 
    at org.sonar.runner.Runner$execute.call(Unknown Source) 
    at org.gradle.api.sonar.runner.SonarRunner.run(SonarRunner.groovy:52) 
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) 
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219) 
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212) 
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201) 
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533) 
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516) 
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) 
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) 
    ... 46 more 
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://localhost:9000/batch/ 
    at org.sonar.runner.Bootstrapper.remoteContent(Bootstrapper.java:125) 
    at org.sonar.runner.Bootstrapper.downloadBatchFiles(Bootstrapper.java:158) 
    ... 59 more 

任何想法,將不勝感激

感謝

+0

看起來它可能是這個問題:https://issues.gradle.org/browse/GRADLE-3062 – 2014-10-10 09:34:10

+0

這是一種享受。把它作爲答案,我會接受它 - 歡呼 – 2014-10-10 09:45:54

回答

2

看起來它might be this issue

在2.2之前的Gradle(尚未出現)中,您無法更改聲納版本。

如果你下載安裝到這個問題的buildSrc拉鍊,並更改爲使用新的插件:

apply plugin: 'sonarqube-runner' 

它將搭載聲納亞軍2.4,並給你一個sonarQubeRunner的任務,應與最新作品SonarQube

當搖籃的2.2被釋放,你可以回滾到舊的插件,但加:

sonarRunner { 
    toolVersion = '2.4' 
} 

位到您的build.gradle到具有以下屬性更新版本

+1

從SonarQube 4.0升級到4.5之後,sonarRunner任務失敗,並帶有gradle 2.1將工具版本2.4添加到build.gradle並使用Gradle每晚構建gradle-2.3-20141019220032爲了我。 – javajon 2014-10-20 17:10:41

1

升級到搖籃2.2解決了這個問題,一起:

apply plugin: 'sonar-runner' 

sonarRunner { 
    sonarProperties { 
     property 'sonar.host.url', 'http://...' 
    } 
}