Jenkins 통합 SonarQube 가 겪 은 오류 문 제 를 해결 하 다.

Jenkins 가 Sonar 를 통합 하 는 과정 에서 만난 오류
1.jenkins 에 sonarqube 의 token 증명 서 를 추가 할 수 없습니다.
추 가 된 증빙 형식 이 잘못 되 었 기 때문에 token 을 추가 할 수 없습니다.형식 은'username with password'가 아 닌'Secret text'를 선택해 야 합 니 다.

2.sonarqube 시작 오류

#    :
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/sonarqube/logs/sonarqube.log

  :   SonarQube       Elasticsearch,      Docker       Elasticsearch               。
  :  Linux  ,           root                    :(      )
  sysctl -w vm.max_map_count=262144
  sysctl -w fs.file-max=65536
  ulimit -n 65536
  ulimit -u 4096
3.es 프로그램 은 sonarqube 디 렉 터 리 에서 자바 를 찾 을 수 없습니다(또는 자바 환경 변 수 를 정의 하지 않 았 습 니 다)
\#전체 오류 보고:
2021.07.12 05:59:54 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
could not find java in ES_JAVA_HOME at /opt/java/openjdk/bin/java
2021.07.12 05:59:54 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2021.07.12 05:59:54 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
이유:sonarqube:9.0.0-comunity 최신 버 전 을 사 용 했 기 때문에 sonar 버 전 문제 일 수 있 습 니 다(잘 모 르 겠 습 니 다)
해결:낮은 버 전 으로 바 꾸 면 이 문제 가 없 을 것 입 니 다.예 를 들 어 sonarqube:8.9.1-community 버 전 입 니 다.
4.sonarqube 하 이 버 전 은 my sql 데이터 베 이 스 를 지원 하지 않 습 니 다.
\#전체 오류 보고:
Exception in thread "main" org.sonar.process.MessageException: Unsupported JDBC driver provider: mysql
원인:sonarqube 7.9 이상 my sql 데이터 베 이 스 를 지원 하지 않 습 니 다.
해결:postgresql,oracle,sqlserver 데이터베이스 로 변경
5.jenkins 프로젝트 에 sonarqube Scanner 오류 설정
\#전체 오류 보고:
ERROR: Tasks support was removed in SonarQube 7.6.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeed?
ERROR: SonarQube scanner exited with non-zero code: 2
해결:Execute SonarQube Scanner 에서 Task to run 란 을 삭제 하고 아무것도 채 우지 마 십시오.
\#완전 오류 신고
org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property,
 or exclude them from the analysis with sonar.exclusions property.
원인:sonarqube 의 sonar-자바 플러그 인 은 4.1.2 부터 sonar.java.binaries 인 자 를 강제로 요구 합 니 다.
해결:Analysis properties 설정 에'sonar.java.binaries'인 자 를 추가 합 니 다.

이로써 Jenkins 집성 SonarQube 가 만난 오류 에 관 한 이 글 은 여기까지 소개 되 었 습 니 다.더 많은 관련 Jenkins 집성 SonarQube 의 오류 내용 은 우리 의 이전 글 을 검색 하거나 아래 의 관련 글 을 계속 조회 하 시기 바 랍 니 다.앞으로 많은 응원 부탁드립니다!

좋은 웹페이지 즐겨찾기