【发布时间】:2018-01-27 10:47:37
【问题描述】:
我有一个前端项目(AngularJS - 不是最新版本)并想用 SonarQube 分析代码。
这是我到目前为止所做的。
1) 从 GitHub 抓取我的项目并克隆到桌面。
2) 下载 SonarQube-6.5 并解压到桌面。
3) 打开sonarqube-6.5\extensions\plugins(在我解压的目录中)并粘贴一个前端插件(从https://github.com/groupe-sii/sonar-web-frontend-plugin下载)
4) 在我的项目的 web 目录中创建了 sonar-project.properties
内容
# Required metadata
sonar.projectKey=project-name
sonar.projectName=project name
sonar.projectVersion=0.1
# Comma-separated paths to directories with sources (required)
sonar.sources=src/app
# exclude some files and folders (typically dependencies)
sonar.exclusions=bower_components/**/*, node_modules/**/*
# Encoding of the source files
sonar.sourceEncoding=UTF-8
然后我在命令行中运行了以下内容。
cd 项目根目录
"c:\\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe" 开始 /k:"orag.sonarqube:sonarqube-scanner-msbuild" /n:"CMNHMobile-nextrelease" /v:"1.0" c:\pathto ms build\MSBuild.exe /t:Rebuild “c:\sonar-scanner-msbuild-3.0.2.656\SonarQube.Scanner.MSBuild.exe” 结束
执行这些步骤后,我的 localhost:9000 (SonarQube) 中没有列出任何项目
我可以做些什么来展示项目以供分析?
【问题讨论】:
-
使用以下插件 (SonarJS) 帮助解决了我的困惑并开始分析 - docs.sonarqube.org/display/PLUG/SonarJS