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.
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):
- PATH_MODULE_CONFIDENTIAL/target/scoverage.xml
The report file(s) can not be found. Check that the property ‘sonar.scala.coverage.reportPaths’ is correctly configured.
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.