Tycho Eclipse Plugin Project Layout Causes S5960 False-Positive Warnings and 0% JaCoCo Coverage

Hi,

An Eclipse plugin project has a different layout from a typical project, which creates several issues.

The tests are located in separate sibling projects. This causes a false-positive warning: “Remove this assertion from production code,” even though it is normal for assertions to appear in the main sources of a test project.

Additionally, coverage remains stuck at 0% because the JaCoCo sensor cannot find the sources.

[INFO] Sensor JaCoCo XML Report Importer [jacoco]

[INFO] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.

Warning: File ‘MavenSourceDownloader.java’ not found in project sources.

Project :

Thanks,

Nicolas Baumann.

Hey @Nicolas_Baumann,

Since the SonarQube for Eclipse plug-in is also based on Tycho, you can have a look at its configuration on how JaCoCo and the Sonar Scanner work together.

The GitHub Actions workflow basically runs all the tests (including integration tests and then aggregates them together) before running the actual scan.
I took a look at your repo and saw that the workflows are a bit more fragmented, this made it a bit harder to follow both the configuration and the resources (reports).

If the repo is not of help, don’t hesitate to come back.

Cheers :beer_mug:

Hello,

I found this old bug 397015 – Consider source roots of eclipse-test-plugin as Maven test source roots and set property sonar.tests as a workaround

Thanks

Nicolas Baumann