Sonar Ant任务执行错误

时间:2014-11-19 10:47:37

标签: ant sonarqube sonar-runner

我写了蚂蚁声纳任务但是当我在控制台中执行时我得到了跟随错误

 E:\Liferay\Liferay 6.2\workspace\plugins\build.xml:305: 
 org.sonar.batch.bootstrapper.BootstrapException: java.io.IOException: 
 Server returned HTTP response code: 400 for URL: http://localhost:9000/sonar/batch/

即使我已经尝试过各种方式 以下是我的蚂蚁目标

<target name="sonar">
            <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
                    <!-- Update the following line, or put the "sonar-ant-task-*.jar" file in your "$HOME/.ant/lib" folder -->
                    <classpath path="D:\sonar-ant-task-1.3.jar" />
            </taskdef>

            <property name="sonar.host.url" value="http://localhost:9000/sonar" />  
            <property name="sonar.jdbc.url" value="jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8" />
            <property name="sonar.jdbc.driverClassName" value="com.mysql.jdbc.Driver" />

            <!-- the username and password of your database -->
            <property name="sonar.jdbc.username" value="root" />
            <property name="sonar.jdbc.password" value="" />

            <!-- list of mandatories Sonar properties -->
            <property name="sonar.sources" value="portlets/${projectName}/docroot/WEB-INF/src" />
            <property name="sonar.projectName" value="${projectNameInSonarPortal}" />       
            <property name="sonar.binaries" value="portlets/${projectName}/docroot/WEB-INF/classes" />
            <property name="sonar.libraries" value="portlets/${projectName}/docroot/WEB-INF/lib" />

            <!-- The console info -->
            <echo>The given project name ${projectName}></echo>
            <echo>The project name in sonar portal ${projectNameInSonarPortal}</echo>
            <echo>The sonar sources directory ${sonar.sources}</echo>
            <!-- Execute Sonar -->
             <sonar:sonar />
            <!--<sonar:sonar key="encore-portal" version="0.1-SNAPSHOT"  xmlns:sonar="antlib:org.sonar.ant"/>-->
        </target>

在sonar.properties中设置的属性

sonar.web.host: localhost
sonar.web.port: 9000
sonar.web.context: /sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver

任何人都可以提供这方面的帮助。我用谷歌搜索了但所有的解决方案都不适用于我。我花了很多时间在这上面。请用我的双手添加财富之手

0 个答案:

没有答案