Hello all. Quite new with sonnar. So far I was able to configure in jenkins my sonarqube server and run maven apps with following code.
withSonarQubeEnv('sonarserver') {
sh 'mvn clean package sonar:sonar'
s
}
This runs successfully and do the analysis plus the maven build and generates a war file.
Now I´m trying to do the same for .net core app. I installed sonarscanner following this link
First step was successfully run
dotnet tool install --global dotnet-sonarscanner
I got:
dotnet tool install --global dotnet-sonarscanner
Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed.
You can invoke the tool using the following command: dotnet-sonarscanner
So I created following code next:
withSonarQubeEnv('sonarserver') {
sh '''
dotnet-sonarscanner begin /k:"proyject-key"
dotnet build solution.sln
dotnet-sonarscanner end
'''
But now I´m getting:
+ dotnet-sonarscanner begin /k:project-key
/var/lib/jenkins/workspace/sonar-test-dotnet@tmp/durable-00ff368b/script.sh: 3: /var/lib/jenkins/workspace/sonar-test-dotnet@tmp/durable-00ff368b/script.sh: dotnet-sonarscanner: not found
[Pipeline] }
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
What Am I missing and how can I configure it? Didn´t the sonnar scanner already installed in first step?
Thank you!
