Hello, I am creating a multimodule maven project and I am applying the step of coverage with scoverage-maven-plugin. However, some of the sub modules are implemented to skip the coverage, since don’t have source files to analyse.
Is there any way to exclude these modules from skipping the sonar coverage analysis?
I tried with sonar.coverage.exclusions, but that will only exclude the files but still makes all the steps of sonar scanner for all the modules.
Some project information
- ALM used: GitHub
- CI system used: GitHub Actions
- Scala/Java with Maven
I’m having a bit of a hard time understanding precisely what you’re trying to accomplish. Maybe you can share some configuration / logs (specifically that show the undesired behavior)?
It’s not a really big issue. But I am avoiding the warning logs
Here’s the log:
[INFO] Sensor Scoverage sensor for Scala coverage [sonarscala]
[WARNING] Unable to import Scoverage report file(s):
The report file(s) can not be found. Check that the property ‘sonar.scala.coverage.reportPaths’ is correctly configured.
The coverage is being analysed for the modules that have the xml file, but I wanted to exclude those which don’t have just to avoid these warnings
Ah, I understand a bit better.
What’s happening is that by configuring
sonar.scala.coverage.reportPaths in your top-level pom.xml, as an analysis parameter (
mvn sonar:sonar -Dsonar.scala.coverage.reportPaths=scoverage.xml), or in the UI, the analysis parameter is applied to each submodule.
One way to workaround this would be to define
sonar.scala.coverage.reportPaths in the pom.xml only of the relevant sub-modules, and make sure you aren’t defining it at the project-level.
Oh, that makes so much sense!
Also, it worked Thank you very much!!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.