# Wildcard support for sonar.junit.reportPaths (Surefire, multi-module Maven)

**URL:** <https://community.sonarsource.com/t/wildcard-support-for-sonar-junit-reportpaths-surefire-multi-module-maven/188238>\
**Category:** Suggest new features\
**Tags:** sonarqube, java, coverage\
**Created:** [September 14, 2026, 5:31pm UTC](https://community.sonarsource.com/t/wildcard-support-for-sonar-junit-reportpaths-surefire-multi-module-maven/188238 "2026-09-14T17:31:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubenlr](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rubenlr/32/77499_2.png) [@rubenlr](https://community.sonarsource.com/u/rubenlr)\
**Post date:** [September 14, 2026, 5:31pm UTC](https://community.sonarsource.com/t/wildcard-support-for-sonar-junit-reportpaths-surefire-multi-module-maven/188238/1 "2026-09-14T17:31:19Z")

</div>

Hi,

I scan a multi-module Maven project with `sonar-scanner-cli`. JaCoCo coverage imports without trouble:

```auto
sonar.coverage.jacoco.xmlReportPaths=coverage.xml,**/target/site/jacoco/jacoco.xml

```

Surefire reports do not, even when I point at directories instead of files:

```auto
sonar.junit.reportPaths= **/target/surefire-reports,** /target/failsafe-reports

```

Log output:

```auto
INFO parsing [.../ **/target/surefire-reports, .../** /target/failsafe-reports]
ERROR Reports path not found or is not a directory: .../**/target/surefire-reports

```

The scanner treats `**` as a literal path. Same if you add `TEST-*.xml` on the end.

The docs say wildcards only apply when a property mentions them. JaCoCo coverage does. `sonar.junit.reportPaths` does not. For a reactor with several modules, that means maintaining a comma-separated list of every `target/surefire-reports` and `target/failsafe-reports` path, or generating that list in CI before each scan. It works, but it drifts when modules get added or renamed.

Proposal: support `?`, `*`, and `**` in `sonar.junit.reportPaths`, expand them to directories, then parse `TEST-*.xml` / `TESTS-*.xml` inside each directory the way SurefireSensor already does. Looks like the right place is `SurefireUtils` in the `java-surefire` module.

I found several threads where people tried globs and got the same error:

- [How do I show the unit test reports in SonarQube?](https://community.sonarsource.com/t/how-do-i-show-the-unit-test-reports-in-sonarqube/107660)
- [JUnit test reports not imported](https://community.sonarsource.com/t/junit-test-reports-not-imported/89105)
- [Number of unit tests is zero](https://community.sonarsource.com/t/number-of-unit-tests-is-zero/26104)
- [SonarQube can’t find my junit xml files](https://community.sonarsource.com/t/sonarqube-can-t-find-my-junit-xml-files/129981)

I can open a PR on [sonar-java](https://github.com/SonarSource/sonar-java) if this seems reasonable.

Thanks

---

<div class="post-metadata">

**Author:** ![andres](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andres/32/76342_2.png) [@andres](https://community.sonarsource.com/u/andres)\
**Post date:** [September 21, 2026, 8:33am UTC](https://community.sonarsource.com/t/wildcard-support-for-sonar-junit-reportpaths-surefire-multi-module-maven/188238/2 "2026-09-21T08:33:04Z")

</div>

Hey @rubenlr, welcome to the Community! Is there any reason why you’re using SonarScanner CLI instead of Scanner for Maven? Our Scanner for Maven usually takes care of setting this property automatically, and this is what we strongly recommend for Maven projects. Your use case is generally discouraged, so I’m not sure if this feature request makes sense for us. But please do let us know if there’s any specific reason!
