Template for a good new topic, formatted with Markdown:
- ALM used Bitbucket Cloud
- CI system used Circle CI
- Scanner command used when applicable ./sonar-scanner
- Languages of the repository java
I use an sonarcloud orb in my multiproject in Circleci and have an issue with jacoco reports.
Sonar cli cannot find jacoco reports:
INFO: Sensor JaCoCo XML Report Importer [jacoco]
WARN: Report doesn't exist: '/home/circleci/repo/*/build/reports/jacoco/test/jacocoTestReport.xml'
I tried also with absolute path, but got same error:
I’m sure the path is correct. It seems the cli cannot recognize “". It only works when I use a path without "” i.e.:
Is it a bug?
I guess file searches is not supported? However dynamically searching for those XML files is pretty simple; add build
sonar.coverage.jacoco.xmlReportPaths parameter like so:
mvn sonar:sonar -Dsonar.projectKey=xyz -Dsonar.coverage.jacoco.xmlReportPaths=$(find "$(pwd)" -path '*jacoco.xml' | sed 's/.*/&/' | tr '\n' ',')
for Maven, or correspondingly for Gradle.
I would like to use sonarqube cli, not maven/gradle plugin.
According to the documentation it should be possible to use “*”
- any number of characters|
** any number of directories|
Well technically, the documentation says
Some properties support the following wildcards in paths. The remarks for properties that support wildcards will mention that fact. If the remarks do not say wildcards are supported, then they are not.
So some, i.e. not all.
Edit: This post is outdated, wildcards are now supported.
Indeed, @skjolber is correct, wildcards are (currently) not supported for
sonar.coverage.jacoco.xmlReportPaths as stated in the documentation you linked.
For the record, I just wanted to say that there is a ticket (JACOCO-15) to add support for wildcards in progress, you can expect them to be supported in the near future!
I have a similar issue, the sonar analysis cannot find the file.
This is the mvn output
[WARNING] No coverage report can be found with sonar.coverage.jacoco.xmlReportPaths='./core/target/site/jacoco/jacoco.xml,core/target/site/jacoco/jacoco.xml
But if I run
ls -la ./core/target/site/jacoco/jacoco.xml
This is the output
-rw-r--r-- 1 root root 1408650 Nov 4 16:09 ./core/target/site/jacoco/jacoco.xml
the file is there.
I configure the path in SonarCould Project and not in the mvn command.
What I did wrong?