我正在使用 Sonar 3.5.1、Java 1.6.0_26 和 Apache Ant 1.9.0;并下载目录下的插件sonar-ant-task-2.1.jar apache-ant-1.9.0/lib/
。
当我运行 ant sonar 任务时,我遇到了错误:
build.xml:115:声纳:声纳不支持“关键”属性
这个问题真的让我疯狂了一个星期。你能告诉我问题是什么吗?
<!-- ========= Define Sonar target ========= -->
<property name="sonar.projectKey" value="org.codehaus.sonar:${eid}-test" />
<property name="sonar.projectName" value="${eid}-test" />
<property name="sonar.sources" value="${src.dir}" />
<property name="sonar.language" value="c++" />
<property name="sonar.binaries" value="${classes.dir}" />
<property name="sonar.surefire.reportsPath" value="${reports.junit.xml.dir}" />
<property name="sonar.cxx.cppcheck.reportPath" value="${reports.dir}/cppcheck-report.xml" />
<property name="sonar.cxx.gcovr.reportPath" value="${reports.dir}/gcovr-report.xml" />
<property name="sonar.cxx.xunit.reportPath" value="${reports.dir}/gtest-report.xml" />
<!-- The following properties are required to use JaCoCo: -->
<!-- 1. Tells Sonar to run the unit tests -->
<!--
<property name="sonar.dynamicAnalysis" value="true" />
-->
<!-- 2. Tells Sonar which "tests" targets to run -->
<!-- 3. Tells Sonar to use JaCoCo as the code coverage engine -->
<!--
<property name="sonar.core.codeCoveragePlugin" value="jacoco" />
-->
<target name="sonar" depends="cppcheck-report">
<sonar:sonar key="org.codehaus.sonar:${eid}-test" version="1.0" xmlns:sonar="antlib:org.sonar.ant" />
</target>
<!-- ========= The main target "all" ========= -->
<!-- Note that depending on the "run-tests" target is not mandatory, as Sonar Ant task will launch it thanks to the "sonar.jacoco.antTargets" property -->
<!-- However, note that compiling is required before running the Sonar Ant task -->
<target name="all" depends="clean,compile,cppcheck-report" />