我们有许多旧项目都有主默认分支,但新项目正在使用 main。目前,我们想保留两个默认分支。是否可以在分析过程中告诉声纳默认分支是什么?
我们正在GitLab中使用maven进行分析,这是maven命令:
mvn --batch-mode --no-transfer-progress -Dmaven.repo.local=.m2/repository -Dsonar.qualitygate.wait=true -B -Dformats=HTML,JSON \
-Dsonar.branch.name=$CI_COMMIT_REF_NAME \
-Dsonar.dependencyCheck.jsonReportPath=target/dependency-check-report.json \
-Dsonar.dependencyCheck.htmlReportPath=target/dependency-check-report.html \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco-unit.xml,target/site/jacoco/jacoco-it.xml \
compile sonar:sonar
尝试传递分支名称参数
-Dsonar.branch.name=<your-branch-name>