我对gitlab ci、maven和sonarcloud有问题。
我使用jdk8,所以我不得不使用 <sonar.scanner.force-deprecated-java-version>true</sonar.scanner.force-deprecated-java-version>
能用声纳,但我还是有一个错误!
gitlab-ci.yml公司
image: maven:latest
variables:
MAVEN_CLI_OPTS: "--batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
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:
paths:
- .m2/repository/
- target/
sonarcloud-check:
image: maven:3.6.3-jdk-8
stage: test
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS compile
test:
stage: test
script:
- mvn $MAVEN_CLI_OPTS test
谢谢你的回复
暂无答案!
目前还没有任何答案,快来回答吧!