SonarQube PL/SQL (.sql) file analysis

sonar.projectDescription=PL/SQL demo

I tried analysing using the above script but I am getting the below error.

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


The bit you shared does not look like script - it is rather just a bunch of properties and values assigned to them. It is also not clear how the scanner is executed here. You may want to save those to in the project root directory (as explained at and re-exeucte the scan.

Hope that helps.

Hi Kris,

sorry for typo,It is not a script, it is a property file contents.I already followed the steps mentioned in the document and installed the sonar scanner in the below path C:\Users\Ganesh\Downloads\sonarqube-\scanner\sonar-scanner- and I saved the property file and script files (.sql) in the below path C:\Users\Ganesh\Downloads\sonarqube-\scanner\sonar-scanner-\bin
I navigated to the root directory (C:\Users\Ganesh\Downloads\sonarqube-\scanner\sonar-scanner-\bin>) and ran the sonar-scanner.bat file but I am getting the error message as “You must define the following mandatory properties for ‘Unknown’: sonar.projectKey”

Hello Ganesh,

it seems like you try to run the scanner using the absolute path while being in the scanner directory:

Add the sonar-scanner.bat location to you PATH environment variable, cd to the directory of the project (where the reside) and run the analysis from there.
Let me know how did that go.

Hi Kris,

I added the sonar-scanner.bat location to my PATH environment variable, cd to the directory and ran the analysis from there,I am still getting the same error message.

Can any one please help on this?

please update.

Hi @Ganesh_M,
As @Krzysztof_Jazgara explained:

  1. Put all properties from your initial comment into a file named “”
  2. Store the file in your project folder C:/Users/Ganesh/Desktop/sqlscripts/
  3. Navigate into the project folder “cd C:/Users/Ganesh/Desktop/sqlscripts”
  4. Invoke the SonarQube scanner “sonar-scanner.bat”
1 Like