542.【DevOps】sonarqube踩坑

分享
手机游戏开发者 2024-9-29 04:11:54 91 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:7MAINTAINER qijing "junfenghe.cloud@qq.com"#设置体系编码RUN yum install kde-l10n-Chinese -yRUN yum install glibc-common -yRUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8ENV LC_ALL zh_CN.UTF-8RUN echo '192.168.3.1    gitlab.xxxxxxx.cn' >> /etc/hostsCOPY ./jdk-19.0.1_linux-x64_bin.tar.gz /RUN tar -zxvf jdk-19.0.1_linux-x64_bin.tar.gzENV JAVA_HOME=/jdk-19.0.1ENV PATH=${PATH}{JAVA_HOME}/binCOPY ./apache-maven-3.8.6-bin.tar.gz /RUN tar -zxvf apache-maven-3.8.6-bin.tar.gzENV MAVEN_HOME=/apache-maven-3.8.6ENV PATH=${PATH}{MAVEN_HOME}/binCOPY ./settings.xml /apache-maven-3.8.6/conf/settings.xml
您需要登录后才可以回帖 登录 | 立即注册

Powered by CangBaoKu v1.0 小黑屋藏宝库It社区( 冀ICP备14008649号 )

GMT+8, 2024-11-24 11:07, Processed in 0.161252 second(s), 32 queries.© 2003-2025 cbk Team.

快速回复 返回顶部 返回列表