Hi Evgeny,

Thank you for viewing and responding on the post. Lets remove the
Integration of Jacoco with SonarQube. After taking a closer look at report
I found there was challenge on the Jacoco xml file which contains only
uncovered lines. The Jacoco xml file which got generated doesnt have
anything or everything shows as counter covered as "Zero". Infact, I
believe it should atleast have some values.

*Following is the format the XML file looks as below with many fields, just
as sample below:*
<report name ="YYY">
   <group name = "ZZZ">
       <package name = "AAA">
           <class name = "BBB">
                <method name ="<init>" line="5" desc="()v">
                   <counter covered ="0" missed ="3" type ="INSTRUCTION"/>
                   <counter covered ="0" missed ="1" type ="LINE"/>
                   <counter covered ="0" missed ="1" type ="COMPLEXITY"/>
                   <counter covered ="0" missed ="1" type ="METHOD"/>

*The index.html file looks as below with no metrics:*
*XYZ*

*element missed instruction cov Missed branches  Cov MissedCXty Missed
Lines MissedMthods MissedClasses*
XYZ                                          0%
     0%   1037   1037   1642    1642    577      577       51        51

Hence, I feel Challenging part is with Jacoco, where not able to pick the
coverage. Is this behaviour expectable or anything we need to consider for
reporting the coverage. Any assistnace provided is greatly appreciated.


-Mohan Reddy

On Wed, 15 Apr 2020 at 16:55, Evgeny Mandrikov <[email protected]> wrote:

> First of all:
> As stated in JaCoCo documentation (
> https://www.jacoco.org/jacoco/trunk/doc/integrations.html ) integration
> with SonarQube is third-party and not developed by JaCoCo team.
> And all questions about third-party integrations should be addressed to
> vendors of these integrations.
>
> Nevertheless:
> as shown in
> https://community.sonarsource.com/t/coverage-test-data-importing-jacoco-coverage-report-in-xml-format/12151
> property "sonar.coverage.jacoco.xmlReportPaths" should point to XML
> file(s) with report(s), not to directory
> in your pom.xml snippets there are no traces of
> https://www.jacoco.org/jacoco/trunk/doc/report-mojo.html that generates
> XML report
>
>
> On Tuesday, April 14, 2020 at 2:10:30 PM UTC+2, Mohan Reddy wrote:
>>
>> Hi Everyone,
>>
>> I was trying to achieve the coverage report generation on sonarqube
>> platform for one of our project. Below are the details.
>> 1. I've a multi module (4 modules) maven project which has the junit test
>> cases written for a single module. I use TeamCity as a CI tool to get the
>> code compiled and perform the cpde coverage through Jacoco plugin (which
>> was written on parent pom.xml file).
>> 2. Whenever I trigger a build, the sonarqube scan process gets started
>> and coverage report doesnt get reflect on sonarqube platform. The build
>> doesnt fail, but never shows the coverage report on sonarqube platform.
>> 3. I've defined the properties on every module as well.
>> 4. Below is the plugin details defined in parent pom.xml file and
>> properties alonein child pom.xml files
>>
>> ---------------properties-child pom-----------
>> <properties>
>> <sonar.coverage.jacoco.xmlReportPaths>${basedir}/../
>> ${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
>> </properties>
>>
>> ---------------Plugin- parent pom------------------
>> <plugin>
>> <groupId>org.jacoco</groupId>
>> <artifactId>jacoco-maven-plugin</artifactId>
>> <version>0.8.4</version>
>> </plugin>
>> </plugins>
>> profiles>
>> <profile>
>> <id>coverage</id>
>> <activation>
>> <activeByDefault>true</activeByDefault>
>> </activation>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.jacoco</groupId>
>> <artifactId>jacoco-maven-plugin</artifactId>
>> <executions>
>> <execution>
>> <id>prepare-agent</id>
>> <goals>
>> <goal>prepare-agent</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>> </profile>
>> </profiles> Can someone please let me know is there anything I'm missing
>> to reflect the code coverage part ? I uses the sonarqube 7.9.1 version, the
>> master branch was first analyzed. Below is the command I passes through
>> TeamCity command - clean verify sonar:sonar Looking forward at your
>> response. -Mohan
>>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/7ba0324a-0588-4b26-ab7d-1192a9c825cd%40googlegroups.com
> <https://groups.google.com/d/msgid/jacoco/7ba0324a-0588-4b26-ab7d-1192a9c825cd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAE-kxOce3r1qyWjsfaH%3DcE_oZJnSPEaaPAqLWamdOj68n%3DOuyQ%40mail.gmail.com.

Reply via email to