Code Coverage using Ant Example

Hey there,

I need you help on getting a project in SonarQube with Ant and Coverage working, I tried to follow some examples however I still get 0% and uncoverage lines in SonarQube, does anyone have any idea or have a concrete example on how to achieve this?

Some basic information

SonarQube version: Community EditionVersion 8.3.1 (build 34397)
build.xml -> attached build.txt (3.5 KB)

I really appreciate your ideas and help
Thanks

Hi,

Your Ant file didn’t come through with any indention, which makes it terribly hard to read. However, my eye did happen to land on this:

<!--  Step 3: Create coverage report  -->
<jacoco:report>
<!--  This task needs the collected execution data and ...  -->
<executiondata>
<file file="${result.exec.file}"/>

So… I guess you’re producing an .exec coverage report? We no longer support that format. You need to create an .xml report instead and update the parameter key.

 
HTH,
Ann

Hi Ann,

You are right, apologies about that, thanks for your comment, one question by any chance do you guys have any sample code of this creation, I’m very new with Ant, I could achieve the coverage using other languages but I’m having a hard time with Ant.

If not, I’ll spend more calories on that and absolutely following your advise,

Thanks a lot,
Romell

Hi Romell,

If you’re not already deeply committed to Ant, then I would advise you to go at this another way. I loved Ant in its day. That was a long time ago. You should look probably at Gradle instead. You should find plenty of examples and advice for it.

 
HTH,
Ann

Thanks a lot Ann for your help

Regards,
Romell

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.