作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
尝试为Angular 7代码库设置Sonarqube,以进行代码覆盖率分析。
获得授权cmd后,我已经安装了Sonarqube并在Admin中创建了一个项目
“” sonar-scanner.bat -D“sonar.projectKey = TestApp” -D“sonar.sources =。” -D“sonar.host.url = http://127.0.0.1:9000” -D“sonar.login = 5089f6d1cc070b3c9e96273405a7e354721030c7”
试图在Angular项目中运行...
它开始扫描项目,但失败了,我是否已配置其他任何文件来运行扫描
“下面是在扫描仪控制台中显示的消息”
INFO: 1024/1024 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=200377ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=256ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=2605ms
INFO: Sensor SonarTS [typescript]
INFO: Since SonarTS v2.0, TypeScript analysis is performed by SonarJS analyzer v6.0 or later. No TypeScript analysis is performed by SonarTS.
INFO: Sensor SonarTS [typescript] (done) | time=20ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=1038ms
INFO: SCM Publisher SCM provider for this project is: svn
INFO: SCM Publisher 2109 source files to be analyzed
INFO:
INFO:
INFO: SCM Publisher 0/2109 source files have been analyzed (done) | time=28586ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 9:48.956s
INFO: Final Memory: 14M/60M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Error when executing blame for file
最佳答案
步骤1-安装Sonarqube
要安装Sonarqube,请先从https://www.sonarqube.org/downloads/.下载Sonarqube
步骤2-使用Angular 配置 Sonar
运行-npm install sonar-scanner --save-dev
在Angular根目录中创建一个名为sonar-project.properties的文件,并添加以下属性
sonar.host.url=http://localhost:9000
sonar.login=admin
sonar.password=admin
sonar.projectKey=test-app
sonar.projectName=test-app
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=**/node_modules/**
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/lcov.info
"scripts": {
"sonar": "sonar-scanner"
}
npm run sonar
关于angular - 如何为Angular 7项目设置 Sonar ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59902276/
我是一名优秀的程序员,十分优秀!