使用sonar-5.3运行sonar-ant-task-1.4时出错

时间:2016-03-02 11:22:18

标签: ant sonarqube

我为sonarqube-5.3下载了zip文件。 http://localhost:9000有效。 我正在尝试运行'ant -f antbuild.xml sonar'命令。 ant版本是1.9.2,sonar-ant任务jar版本是1.4。

我遇到以下异常:

sonar:
[sonar:sonar] Apache Ant(TM) version 1.9.2 compiled on July 8 2013
[sonar:sonar] Sonar Ant Task version: 1.4
[sonar:sonar] Loaded from: file:/C:/FI1/runner/sonar-ant-task-1.4.jar
[sonar:sonar] Sonar work directory: C:\FI1\runner\.sonar
[sonar:sonar] Sonar server: http://localhost:9000
[sonar:sonar] Sonar version: 5.3

BUILD FAILED
C:\FI1\runner\antbuild.xml:39: org.sonar.batch.bootstrapper.BootstrapException:
org.sonar.batch.bootstrapper.BootstrapException: Fail to download the file: 
http://localhost:9000/batch/sonar-batch-shaded-5.3.jar|3659a1916b6b99eb1f6567db76884fcd
        at org.sonar.batch.bootstrapper.Bootstrapper.downloadBatchFiles(Bootstrapper.java:164)
        at org.sonar.batch.bootstrapper.Bootstrapper.createClassLoader(Bootstrapper.java:87)
        at org.sonar.ant.SonarTask.createClassLoader(SonarTask.java:257)
        at org.sonar.ant.SonarTask.execute(SonarTask.java:193)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.sonar.batch.bootstrapper.BootstrapException: Fail to download the file: http://localhost:9000/batch/sonar-batch-shaded-5.3.jar|3659a1916b6b99eb1f6567db76884fcd

任何帮助将不胜感激。

此致 Amey

1 个答案:

答案 0 :(得分:1)

您必须升级SonarQube Scanner for Ant。您当前的Ant任务版本(1.4)与SonarQube版本(5.3)不兼容。这个compatibility matrix表明v2.2是自SonarQube 3.7以来的最低要求(2.4是SonarQube 4.5 +的最佳选择)。