大佬 我按照你这种方式 是可以加载到sonar 但是我sonar加载完后报错
#####报错信息
No previous SonarQube analysis found on this pipeline execution. Please use the ‘withSonarQubeEnv’ wrapper to run your analysis.
######
我的通过kubesphere生成的Jenkinsfile
stage('Code Analysis') {
agent none
steps {
container('maven') {
withCredentials([string(credentialsId : 'sonar' ,variable : 'SONAR_TOKEN' ,)]) {
withSonarQubeEnv('sonar') {
sh '''mvn -B sonar:sonar -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey=demo-test
'''
timeout(unit: 'MINUTES', activity: true, time: 2) {
waitForQualityGate 'true'
}
}
}
}
}
}