美文网首页js css htmlDevOps
542.【DevOps】sonarqube踩坑

542.【DevOps】sonarqube踩坑

作者: 七镜 | 来源:发表于2023-01-06 09:13 被阅读0次

    一、ERROR: Not authorized. Analyzing this project requires to be authenticated. Please provide the values of the properties sonar.login and sonar.password.

    解决办法1:


    • 进入sonarqube管理界面,点击【配置】、【权限】、将【Force user authentication】关闭。并刷新gitlab的流水线缓存
      解决方法2:
    sonarqube-check:
      image: registry.xxxx.cn/maven:3.8.6-jdk-19
      variables:
        SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
        GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task
      cache:
        key: "${CI_JOB_NAME}"
        paths:
          - .sonar/cache
      script:
        - mvn clean install
        - mvn verify sonar:sonar -Dsun.jnu.encoding=UTF-8 -Dsonar.login=sqp_36374d3c63c6fd8289f46be89ae008ef5179cbe -Dsonar.projectKey=ecosystem_edata-server_AYVEHWnlpBkFJxpVWDSg
      allow_failure: true
      only:
        - <yourbranch>
    
    • 编辑 .gitlab-ci.yml,添加mvn 的参数 -Dsonar.login

    二、[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project edata-parent: Malformed input or input contains unmappable characters: docs/������.md

    这个乱码问题是maven:3.8.6-jdk-19这个镜像不支持中文导致的,已经将Dockerfile做了修改,这里再发一遍

    FROM centos:7
    
    MAINTAINER qijing "junfenghe.cloud@qq.com"
    
    #设置系统编码
    RUN yum install kde-l10n-Chinese -y
    RUN yum install glibc-common -y
    RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
    ENV LC_ALL zh_CN.UTF-8
    
    RUN echo '192.168.3.1    gitlab.xxxxxxx.cn' >> /etc/hosts
    
    COPY ./jdk-19.0.1_linux-x64_bin.tar.gz /
    RUN tar -zxvf jdk-19.0.1_linux-x64_bin.tar.gz
    ENV JAVA_HOME=/jdk-19.0.1
    ENV PATH=${PATH}:${JAVA_HOME}/bin
    
    COPY ./apache-maven-3.8.6-bin.tar.gz /
    RUN tar -zxvf apache-maven-3.8.6-bin.tar.gz
    ENV MAVEN_HOME=/apache-maven-3.8.6
    ENV PATH=${PATH}:${MAVEN_HOME}/bin
    
    COPY ./settings.xml /apache-maven-3.8.6/conf/settings.xml
    

    相关文章

      网友评论

        本文标题:542.【DevOps】sonarqube踩坑

        本文链接:https://www.haomeiwen.com/subject/cvuiqdtx.html