Alternative to sonar.analysis.mode parameter

雨燕双飞 提交于 2021-01-03 06:47:45

问题


I'm using Sonarqube 7.9 and Gitlab with a maven docker image that calls my Sonarqube using mvn --batch-mode verify sonar:sonar -DskipTests=true -Drevision=$REVISION_UNSTABLE $SONAR_OPTS -Dsonar.analysis.mode=issues.

The thing is that the parameter sonar.analysis.mode is not used anymore since version 7.4 but I can't find out what parameter do I need to use instead.

At the build development branch I just want to check the issues related to the code and I don't want to publish anything. Only when I publish a tag or a production code I must publish results to Sonarqube interface. So what do I need to run my code with the previous issues and publish parameters? Is there any alternative to sonar.analysis.mode?


回答1:


The direction SonarSource are pushing people in is to use branch/pull-request analysis to detect new issues across branches. I'd suggest you want to be using feature branches for your typical analysis if you're not wanting to retain history for a long time.

The branch analysis feature requires you use Developer Edition to work out-the-box, however there is a plugin that provides branch support on developer edition should you want to try it.

Your build/scan command would then become something similar to:

mvn verify sonar:sonar -DskipTests=true -Drevision=$REVISION_UNSTABLE $SONAR_OPTS -Dsonar.branch.name=develop


来源:https://stackoverflow.com/questions/57100631/alternative-to-sonar-analysis-mode-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!