执行build.xml时在声纳任务中获取错误

时间:2014-06-21 06:14:32

标签: sonarqube

我已经在我的构建xml中配置了声纳,如下所示,但是在执行我的build.xml时,我收到以下错误。可以告诉我如何克服此错误

target name="sonar">
                        <echo message="**** thirdparty.lib.dir -- >  ${thirdparty.lib.dir}/sonar ****"/>
            <sonar:sonar workDir="${build.dir}" key="gtr_61.all.rules:dev" version="1.0" xmlns:sonar="antlib:org.sonar.ant">

                <!-- source directories (required) -->
                <sources>
                    <path location="${pps.dir}/src" />
                    <path location="${pn.dir}/src" />
                </sources>
                <property key="sonar.host.url" value="https://abc/" />  
                <property key="sonar.jdbc.url" value="jdbc:oracle:thin:abc" />
                <property key="sonar.jdbc.driverClassName" value="oracle.jdbc.driver.OracleDriver" />
                <property key="sonar.jdbc.username" value="=AAA" />
                <property key="sonar.jdbc.password" value="BBB" />
                <property name="sonar.scm.url" value="https://svn.ats" />
                <property name="sonar.java.source" value="1.5" />
                <property name="sonar.language" value="java"/>
                <property name="sonar.projectVersion" value="1.0"/>

                <tstamp prefix="build-info">
                        <format property="current-date" pattern="dd-MMM-yyyy" locale="en" />
                        <format property="current-time" pattern="HH:mm:ss z" locale="en" />
                        <format property="year-month-day" pattern="yyyy-MM-dd" locale="en" />
            </tstamp>

                <!-- cobertura -->
                <property key="sonar.cobertura.reportPath" value="cobertura-report/coverage.xml" />
                <property key="sonar.dynamicAnalysis" value="reuseReports" />

                <!-- binaries directories, which contain for example the compiled Java bytecode (optional) -->
                <binaries>
                    <path location="${ps.dir}/build/classes" />
                    <path location="${omm.dir}/build/classes" />
                </binaries>

                <!-- path to libraries (optional). These libraries are for example used by the Java Findbugs plugin -->
                <libraries>
                    <path location="${lib.dir}" />
                </libraries>
                            <property key="sonar.profile" value="abc Rule" />
                            <!--property key="sonar.profile" value="Custom Rules" -->
            </sonar:sonar>

我得到的错误是..

onar
[06:56:15]echo
[06:56:15]**** thirdparty.lib.dir -- > /opt/app//buildAgent-8.0.3/work/pla/lib/thirdparty/sonar ****
[06:56:15]sonar:sonar
[06:56:15]property doesn't support the "name" attribute

2 个答案:

答案 0 :(得分:0)

如果我的感觉是正确的,那么您使用的是SonarQube Ant任务的旧版本。以下是配置此SonarQube Ant任务的方法:http://docs.codehaus.org/display/SONAR/Analyzing+with+SonarQube+Ant+Task

答案 1 :(得分:0)