ERROR: You must define the following mandatory properties for 'Unknown': sonar.projectKey

Hi Team, I Updated the sonar scanner version from 3.2.0 to 4.8.0. After this change project configuration file not picking and analysis is failing.

with sonar-scanner-cli-3.2.0:

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties 
**10:52:49** INFO: Project root configuration file: /opt/workDir/TestSrc/sonar-project.properties 
**10:52:49** INFO: SonarQube Scanner 3.2.0.1227 
**10:52:49** INFO: Java 11.0.12 Alpine (64-bit)

with sonar-scanner-cli-4.8.0:

**14:56:47** INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties 
**14:56:47** INFO: Project root configuration file: NONE 
**14:56:47** INFO: SonarScanner 4.8.0.2856 
**14:56:47** INFO: Java 11.0.14 Alpine (64-bit)

Hi,

Version 3.2 was pretty old & no doubt some things have changed since then. sonar-project.properties is expected to be in your project root directory, which is where analysis is presumed to be started from.

 
HTH,
Ann