Multi Module Gradle/Jenkins

Using Gradle Plugin 2.6.2.

It appears that the scan is not respecting sonar.projectBaseDir. When I run the scan locally using Sonar Scanner 3.2 everything works as expected. However when the job runs on Jenkins using 2.6.2 Gradle plugin, it’s not picking the right directory, and as such it’s not finding any files to scan. This seems to be a common issue I’ve found references to online (i.e. https://stackoverflow.com/questions/48080865/how-to-set-sonar-projectbasedir-in-sonarqube-scanner-for-jenkins) but I cannot find a solution that works for me.

Snippet from config:

sonar.projectBaseDir=modules
sonar.modules=common,logger,server

No matter what I set it doesn’t seem to pick the right directory. Is there a solution for this?

Hi @djr731,

Apologies for resurrecting this old post, but I wanted to give an update here in case others have a similar issue.

Please try upgrading your SonarScanner for Gradle to 3.0 and compare your project setup with our Sonar Scanning Examples repository. Here’s the one you can use to compare multi-module Gradle project:

Joe