我有一个前端项目(AngularJS - 不是最新版本(,想用SonarQube分析代码。
这是我到目前为止所做的。
1(从GitHub抓取我的项目并克隆到桌面。
2(下载SonarQube-6.5并解压缩到桌面。
3(打开sonarqube-6.5\extensions\插件(在我提取的目录中(并粘贴了一个前端插件(从 https://github.com/groupe-sii/sonar-web-frontend-plugin 下载(
4(在我的项目的Web目录中创建了声纳项目属性
内容
# 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" begin/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" 结束
完成这些步骤后,我在本地主机中没有看到任何项目列出:9000(SonarQube(
如何显示项目以供分析?
这是SonarJS项目github主页,您可以在其中获得最新更新:https://github.com/SonarSource/SonarJS
使用以下插件(SonarJS(帮助解决了我的困惑并开始分析 - docs.sonarqube.org/display/PLUG/SonarJS