• DevOps
  • 代码质量检查报错

检测 vue 跟 .net core,根据官方java的例子 settings.xml 文件未做修改

配置文件
stage(‘代码质量检查’) {
steps {
container(‘maven’) {
withSonarQubeEnv(‘sonar’) {
sh ‘mvn sonar:sonar -o -gs pwd/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.login=48d8829b2db174b5989001a5188471fc4baed9ea’
}
timeout(time: 1, unit: ‘HOURS’) {
waitForQualityGate true
}
}
}
}

错误如下:
++ pwd

  • mvn sonar:sonar -o -gs /home/jenkins/agent/workspace/project-J328MqZpVZ5K/TomatoCloudCenter-Web/configuration/settings.xml -Dsonar.branch= -Dsonar.login=48d8829b2db174b5989001a5188471fc4baed9ea
    [INFO] Scanning for projects…
    [WARNING] The POM for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-clean-plugin:jar:2.5 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-install-plugin:jar:2.4 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-install-plugin:jar:2.4 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-site-plugin:jar:3.3 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-site-plugin:jar:3.3 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-dependency-plugin:jar:2.8 has not been downloaded from it before.
    [WARNING] The POM for org.apache.maven.plugins:maven-release-plugin:jar:2.5.3 is missing, no dependency information available
    [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.5.3: Plugin org.apache.maven.plugins:maven-release-plugin:2.5.3 or one of its dependencies could not be resolved: Cannot access repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) in offline mode and the artifact org.apache.maven.plugins:maven-release-plugin:jar:2.5.3 has not been downloaded from it before.
    [INFO] ————————————————————————
    [INFO] BUILD FAILURE
    [INFO] ————————————————————————
    [INFO] Total time: 5.154 s
    [INFO] Finished at: 2020-05-15T06:58:52Z
    [INFO] ————————————————————————
    [ERROR] No plugin found for prefix ‘sonar’ in the current project and in the plugin groups [org.jenkins-ci.tools, org.sonarsource.scanner.maven, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/jenkins/agent/workspace/project-J328MqZpVZ5K/TomatoCloudCenter-Web/artifacts/m2), repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
    script returned exit code 1

    1,请说明 KubeSphere 的环境和使用的示例代码分支
    2,请检查 SonarQube 安装 Ok

    6 个月 后