i m trying to integrate sonarCloud but not able to scan my swift code help me out, using macos ERROR: SonarQube server [http://localhost:9000] can not be reached
check attachment SS
this key i have set in sonar-scanner.properties , i have tried manually setup select macos also tried objectiveC command but getting error like ,below
15:45:53.928 ERROR: Error during SonarScanner execution, org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
also getting error on buildwrapper command : The following build commands failed:
** SwiftGeneratePch normal arm64 Compiling\ bridging\ header (in target ‘ShowMeScreenShare’ from project ‘ShowMeByBlitzz’)**
i also getting this error
ERROR: Project not found. Please check the ‘sonar.projectKey’ and ‘sonar.organization’ properties, the ‘SONAR_TOKEN’ environment variable, or contact the project administrator
First, let me suggest you get rid of everything in sonar-scanner.properties and focus on only passing configuration through the commands specified in the UI tutorials.
Second – can you clarify what language(s) you are trying to analyze? Only Swift code, or some C/C++/Objective-C as well?
Okay. In that case, forget about the build wrapper and make sure you’ve configured sonar.c.file.suffixes=- (also for cpp and objc) as you were in the screenshot above (but don’t do this in a sonar-scanner.properties file).
If you’re still receiving this error:
I suggest posting your analysis logs in full, so it’s clear at what stage of the analysis the issue is being raised.
hi colin sonar setup is done but showing Master branch how can i add another branch local development branch because i m doing my changes in dev branch please guide me accordingly. for iOS swift code
hi colin checked this doc in this below description where i have to set this two parameter in environ variable or sonar property list ? also check attachment renaming branch with current branch name it will auto analys branch that we want to be analys?
using this command sonar-scanner
-Dsonar.organization=blitzz-organization
-Dsonar.projectKey=Blitzz_ShowMe_iOS
-Dsonar.sources=.
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.branch.name=Task_22433_SonarQubeSetup
Note: using terminal for setup manually
Under the hood
Internally, when the SonarScanner performs a branch analysis in an integrated CI, it automatically sets two analysis parameters:
sonar.branch.name: The name of the branch that was analyzed.
sonar.branch.target: The name of the target branch of the branch that was analyzed.
How do i change default Master branch to Another branch? which steps i have to follow where to mention branch parameter? using terminal for Sonar scan for Swift projecr
Starting in SonarQube v10.2 you can set another branch to be the main branch
Your only option in versions before that (or in SonarCloud) is to rename the existing branch (or start over from a new project and configure the branch name on project creation)
Hello Colin
i have recreate Project can you guide me where to mention branch name ?
in sonar properti file or in command line like below
sonar-scanner
-Dsonar.organization=XXX
-Dsonar.projectKey=XXX
-Dsonar.sources=.
-Dsonar.host.url=https://sonarcloud.io