一、ERROR: Not authorized. Analyzing this project requires to be authenticated. Please provide the values of the properties sonar.login and sonar.password.
解決辦法1:
- 進入sonarqube管理界面全闷,點擊【配置】动看、【權(quán)限】、將【Force user authentication】關(guān)閉绢馍。并刷新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 的參數(shù) -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
這個鏡像不支持中文導(dǎo)致的吃溅,已經(jīng)將Dockerfile做了修改,這里再發(fā)一遍
FROM centos:7
MAINTAINER qijing "junfenghe.cloud@qq.com"
#設(shè)置系統(tǒng)編碼
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