Daniel Raap
2011-06-10 07:14:17 UTC
Hello list,
i've tried to analyze our ant build software with sonar. Because it consists
of different parts which are separate eclipse projects I wanted to use the
new multi-modules feature of the sonar ant task 1.1. But for me it doesn't
work and always complains about "SonarException: Can not add twice the same
measure on .".
I think the problem is, that the workdir already contains results of that
sensor. At the moment it fails for the second module at "Sensor
ProfileSensor..." because I created an empty quality profile. Else it was
failing at "Squid extraction..." with quality profile "Sonar way".
Here are the build.xml snippets according to the example in the wiki
(http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task#AnalysewithAnt
Task-Analysemultimodulesproject):
Parent:
<target name="sonar">
<property name="sonar.jdbc.url" value="." />
<property name="sonar.jdbc.driverClassName"
value="com.mysql.jdbc.Driver" />
<property name="sonar.jdbc.username"
value="." />
<property name="sonar.jdbc.password"
value="." />
<property name="sonar.host.url"
value="http://sonar:80" />
<property name="sonar.modules"
value="Child1/build.xml,Child2/build.xml,Child3/build.xml,Child4/build.xml"
/>
<sonar:sonar key="com.example:Parent"
version="1.0" xmlns:sonar="antlib:org.sonar.ant"/>
</target>
Child1 and Child2 have these properties global in the build.xml (directly
underneath the <project> tag):
<property name="sonar.projectKey" value="com.example:Child1" />
<property name="sonar.sources" value="${src.dir}" />
<property name="sonar.binaries" value="${compiled.classes}" />
<property name="sonar.libraries" value="${lib.dir}" />
<property name="sonar.profile" value="Empty" />
<property name="sonar.dynamicAnalysis" value="false" />
Find the ant output attached.
Is there a property that has to be defined where to place the reports or is
the multi-module functionality not yet working properly?
Best regards
Daniel Raap
i've tried to analyze our ant build software with sonar. Because it consists
of different parts which are separate eclipse projects I wanted to use the
new multi-modules feature of the sonar ant task 1.1. But for me it doesn't
work and always complains about "SonarException: Can not add twice the same
measure on .".
I think the problem is, that the workdir already contains results of that
sensor. At the moment it fails for the second module at "Sensor
ProfileSensor..." because I created an empty quality profile. Else it was
failing at "Squid extraction..." with quality profile "Sonar way".
Here are the build.xml snippets according to the example in the wiki
(http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task#AnalysewithAnt
Task-Analysemultimodulesproject):
Parent:
<target name="sonar">
<property name="sonar.jdbc.url" value="." />
<property name="sonar.jdbc.driverClassName"
value="com.mysql.jdbc.Driver" />
<property name="sonar.jdbc.username"
value="." />
<property name="sonar.jdbc.password"
value="." />
<property name="sonar.host.url"
value="http://sonar:80" />
<property name="sonar.modules"
value="Child1/build.xml,Child2/build.xml,Child3/build.xml,Child4/build.xml"
/>
<sonar:sonar key="com.example:Parent"
version="1.0" xmlns:sonar="antlib:org.sonar.ant"/>
</target>
Child1 and Child2 have these properties global in the build.xml (directly
underneath the <project> tag):
<property name="sonar.projectKey" value="com.example:Child1" />
<property name="sonar.sources" value="${src.dir}" />
<property name="sonar.binaries" value="${compiled.classes}" />
<property name="sonar.libraries" value="${lib.dir}" />
<property name="sonar.profile" value="Empty" />
<property name="sonar.dynamicAnalysis" value="false" />
Find the ant output attached.
Is there a property that has to be defined where to place the reports or is
the multi-module functionality not yet working properly?
Best regards
Daniel Raap