------------恢复内容开始------------
1. docker 上启动server: docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9067:9000 sonarqube:latest
2. 主机(windows)打开浏览器:http://192.168.40.139:9067 修改密码之后进去,新建 project: qgb
3. 选择manully
4. 下一步
5. 安装 scanner
6. 到一个 dotnet core 项目里执行:
D:\Work\Test\WebApplication2>dotnet sonarscanner begin /k:"qgb" /d:sonar.host.url="http://192.168.40.139:9067" /d:sonar.login="983494ef699772053c65cad63e338bd6d214a686" SonarScanner for MSBuild 5.5.3 Using the .NET Core version of the Scanner for MSBuild Pre-processing started. Preparing working directories... 16:23:50.171 Updating build integration targets... 16:23:51.208 Fetching analysis configuration settings... 16:23:54.884 Provisioning analyzer assemblies for cs... 16:23:54.886 Installing required Roslyn analyzers... 16:23:56.073 Provisioning analyzer assemblies for vbnet... 16:23:56.074 Installing required Roslyn analyzers... 16:23:56.11 Pre-processing succeeded.
这个命令,会生成 .sonarqube 文件夹
D:\Work\Test\WebApplication2\.sonarqube>tree /F
Folder PATH listing
Volume serial number is B418-ADE9
D:.
├─bin
│ │ SonarScanner.MSBuild.Common.dll
│ │ SonarScanner.MSBuild.Tasks.dll
│ │
│ └─targets
│ SonarQube.Integration.targets
│
├─conf
│ │ Sonar-cs-none.ruleset
│ │ Sonar-cs.ruleset
│ │ Sonar-vbnet-none.ruleset
│ │ Sonar-vbnet.ruleset
│ │ SonarQubeAnalysisConfig.xml
│ │
│ ├─cs
│ │ SonarLint.xml
│ │
│ └─vbnet
│ SonarLint.xml
│
└─out
dotnet sonarscanner end /d:sonar.login="983494ef699772053c65cad63e338bd6d214a686983494ef699772053c65cad63e338bd6d214a686"
之后,会 生成下面文件