SonarQube server [http://localhost:9000] can not be reached

Hello,

Im using SonarQube Developer edition version 9.1.0.47736
On my machine with Windows 10 with Visual Studio 2019 e net core 3.1 , net framework 4.5

My project contains a web app ui written in javascript using vue js.
I did so:
I my folder (Main.Web) of javascript project front end I download and extracted, sonar-scanner-4.7.0.2747-windows
So i have this structure on my disk:

Main.Web
src (where i have files to analize)
sonar-scanner-4.7.0.2747-windows
(others folders not to be analyzed)

Inside sonar scanner unzipped folder, into bin folder, i have created:
sonar-project.properties and in this is the file:

sonar.projectKey=Main.Web
sonar.projectName=Main.Web
sonar.projectVersion=1.0
sonar.language=js
sonar.sources=C:\Main.Web\src
sonar.sourceEncoding=UTF-8
sonar.host.url=http://sonarserver:9100
sonar.exclusions=src//*.test.ts sonar.test.inclusions=src//.test.ts sonar.coverage.exclusions=src/**/.test.ts,src/**/.mock.ts,node_modules/,coverage/lcov-report/* sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.testExecutionReportPaths=coverage/test-reporter.xml

I had put in path the bin folder,so if i launch sonar-scanner.bat from bin
I get:

sonar-scanner -Dsonar.login=“token”
INFO: Scanner configuration file: C:\Program Files\sonar-scanner-4.7.0.2747-windows\bin…\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.14.1 Eclipse Adoptium (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\Aa.sonar\cache

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

I dont understand the error.
Can anyone help me?
Thanks

Hey there.

It would be really helpful if the error message in the title of your post matched the error message you’re… posting about.

The sonar-project.properties file should be in the folder from which you’re executing analysis (the folder you’re in when you execute sonar-scanner, probably the root of your project), not in the installation directory of the scanner

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.