Sonarqube 蚂蚁声纳不工作

Sonarqube 蚂蚁声纳不工作,sonarqube,Sonarqube,总时间:0秒您正在尝试使用最新版本的Ant任务(2.0)的“syntaxt”,但这似乎不是类路径中的版本。看起来您缺少build.xml文件中的必需SonarQube属性值 从 <target name="sonar"> <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> </taskdef>

总时间:0秒

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

看起来您缺少build.xml文件中的必需SonarQube属性值

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

            <sonar:sonar />
    </target>
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)
<!-- Define the SonarQube global properties (the most usual way is to pass 
these properties via the command line) -->
<property name="sonar.host.url" value="http://localhost:9000" />

...

<!-- Define the SonarQube project properties -->
<property name="sonar.projectKey" value="org.sonarqube:sonarqube-scanner-ant" />
<property name="sonar.projectName" value="Example of SonarQube Scanner for Ant Usage" />
<property name="sonar.projectVersion" value="1.0" />
<property name="sonar.sources" value="src" />
<property name="sonar.java.binaries" value="build" />
<property name="sonar.java.libraries" value="lib/*.jar" />
ant sonar -Dsonar.projectVersion=1.1