声纳Ant任务执行错误(Sonar Ant task execution error)

2019-10-21 07:05发布

我写的蚂蚁声纳任务,但是当我在控制台执行我我得到以下错误

 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/

连我都尝试过所有的方法,以下是我的Ant目标

<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

任何人都可以帮上this.I用Google搜索,但所有的解决方案,没有工作的我。我花了很多时间在this.Please增加财富的手与我的手

文章来源: Sonar Ant task execution error