When I run pipeline, in sonarquibe analysis stage getting below error:
/usr/lib64/dotnet/sdk/8.0.104/NuGet.targets(156,5): error : ‘latest’ is not a valid version string. (Parameter ‘value’)
This is my pipeline code in the below:–
stage('SonarQube Analysis with .NET') {
steps {
script {
withSonarQubeEnv('sonar-scanner') {
dir('TLH-Dev-Backend') {
sh '''
set -e
dotnet tool install --global dotnet-sonarscanner || true
# Use your NuGet.Config explicitly here
dotnet restore /var/lib/jenkins/workspace/DEV/TLH-Dev-Backend/6-Construction/aspnet-core/TLH.sln --configfile ../../NuGet.Config
dotnet sonarscanner begin \
/k:"KleensyBackendOlddev" \
/n:"KleensyBackendOlddev" \
/v:"1.0" \
/d:sonar.login="squ_c53a1d25eabc0b5de4269486e6c298a592ba4cf1" \
/d:sonar.inclusions="**/*.cs" \
/d:sonar.host.url="http://172.16.7.213:9000"
dotnet build /var/lib/jenkins/workspace/DEV/TLH-Dev-Backend/6-Construction/aspnet-core/TLH.sln
dotnet sonarscanner end /d:sonar.login="squ_c53a1d25eabc0b5de4269486e6c298a592ba4cf1"
'''
}
}
}
}
}
Getting error:—
/usr/lib64/dotnet/sdk/8.0.104/NuGet.targets(679,5): error : File '/var/lib/jenkins/workspace/DEV/TLH-Dev-Backend/TLH-Dev-Backend/NuGet.Config' does not exist. [/var/lib/jenkins/workspace/DEV/TLH-Dev-Backend/6-Construction/aspnet-core/CustomerApp/TLH.CustomerApp.CustomerApplicationService/TLH.CustomerApp.CustomerApplicationService.csproj]
What need to change not understand. But when run pipeline command manually in workspace, that time no error give. Please suggest me what need to do.