蚂蚁声纳不工作

时间:2012-10-16 06:04:47

标签: sonarqube

 <target name="sonar">
            <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
            </taskdef>

            <sonar:sonar />
    </target>

我也设置了SONAR_HOME环境变量但是当我执行“ant sonar”时,我得到以下错误,我错过了什么

BUILD FAILED
/root/.jenkins/jobs/Project/workspace/dev/archive/build.xml:108: java.lang.IllegalArgumentException:
The following mandatory information is missing:
- task attribute 'key'
- task attribute 'version'
    at org.sonar.ant.SonarTask.checkMandatoryProperties(SonarTask.java:212)
    at org.sonar.ant.SonarTask.execute(SonarTask.java:190)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    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:392)
    at org.apache.tools.ant.Target.performTasks(Target.java:413)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:811)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

总时间:0秒

1 个答案:

答案 0 :(得分:0)

您正在尝试使用最新版Ant任务(2.0)的“语法”,但似乎这不是您在类路径中的版本。