gpt4 book ai didi

maven - Sonar 未导入coverage.xml结果

转载 作者:行者123 更新时间:2023-12-02 14:30:38 24 4
gpt4 key购买 nike

我正在使用SonarQube 5.1,声纳运行器2.4,grails 2.4.4和cobertura。
我能够生成coverage.xml文件,但是使用声纳运行器或mvn声纳:声纳在SonarQube仪表板中不显示任何测试Coverag ...什么都没有...
任何的想法?

sonar-project.properties文件:

sonar.projectKey=test
sonar.projectName=test
sonar.projectVersion=1.0

sonar.sources=src/java,src/groovy,grails-app/assets,grails-app/services,grails-app/controllers,grails-app/domain,grails-app/views

sonar.language=grvy
sonar.sourceEncoding=UTF-8

sonar.dynamicAnalysis=reuseReports

sonar.surefire.reportsPath=target/test-reports
sonar.groovy.cobertura.reportPath=target/test-reports/cobertura/coverage.xml

这是声纳运行器的痕迹:
  C:\Temp\sonar-runner-dist-2.4\sonar-runner-2.4

"C:\Program Files\Java\jdk1.7.0_71\bin\java.exe" -cp "C:\Temp\sonar-runner-dist-2.4\sonar-runner-2.4\lib\sonar-runner-dist-2.4.jar" "-Drunner.home=C:\Temp\sonar-runner-dist-2.4\sonar-runner-2.4" "-Dproject.home=C:\test" org.sonar.runner.Main

SonarQube Runner 2.4

Java 1.7.0_71 Oracle Corporation (64-bit)

Windows 7 6.1 amd64

INFO: Runner configuration file: C:\Temp\sonar-runner-dist-2.4\sonar-runner-2.4\conf\sonar-runner.properties

INFO: Project configuration file: C:\test\sonar-project.properties

INFO: Default locale: "no_NO", source code encoding: "UTF-8"

INFO: Work directory: C:\test\.\.sonar

INFO: SonarQube Server 5.1

INFO - Load global repositories

INFO - Load global repositories (done) | time=384ms

INFO - Server id: 20150918133629

INFO - User cache: R:\Users\kho\.sonar\cache

INFO - Install plugins

INFO - Install JDBC driver

INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8

INFO - Initializing Hibernate

INFO - Load project repositories

INFO - Load project repositories (done) | time=255ms

INFO - Load project settings

INFO - Load technical debt model

INFO - Apply project exclusions

WARN - 'sonar.dynamicAnalysis' is deprecated since version 4.3 and should no longer be used.

INFO - ------------- Scan Abonnementsregisteret

INFO - Load module settings

INFO - Language is forced to grvy

INFO - Load rules

INFO - Base dir: C:\test

INFO - Working dir: C:\test\.sonar

INFO - Source paths: test/unit, test/integration, src/java, src/groovy, grails-app/assets, grails-app/services, grails-app/controllers

grails-app/domain, grails-app/views

INFO - Source encoding: UTF-8, default locale: no_NO

INFO - Index files

INFO - 23 files indexed

INFO - Quality profile for grvy: Sonar way

INFO - Sensor Lines Sensor

INFO - Sensor Lines Sensor (done) | time=47ms

INFO - Sensor QProfileSensor

INFO - Sensor QProfileSensor (done) | time=9ms

INFO - Sensor InitialOpenIssuesSensor

INFO - Sensor InitialOpenIssuesSensor (done) | time=111ms

INFO - Sensor ProjectLinksSensor

INFO - Sensor ProjectLinksSensor (done) | time=34ms

INFO - Sensor VersionEventsSensor

INFO - Sensor VersionEventsSensor (done) | time=67ms

INFO - Sensor CodeNarc

INFO - Executing CodeNarc

INFO - Loaded properties file in 72ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report1.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=0) 4030ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report2.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=2) 600ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report3.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=0) 158ms

INFO - Loaded properties file in 0ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report4.xml] created.

CodeNarc completed: (p1=0; p2=5; p3=0) 472ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report5.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=0) 84ms

INFO - Loaded properties file in 0ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report6.xml] created.

CodeNarc completed: (p1=0; p2=10; p3=2) 1271ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report7.xml] created.

CodeNarc completed: (p1=0; p2=7; p3=0) 562ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report8.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=0) 241ms

INFO - Loaded properties file in 1ms; 346 rules

INFO - Loading ruleset from [file:C:\test\.sonar\codenarc\profile.xml]

INFO - RuleSet configuration properties file [codenarc.properties] not found.

INFO - No custom message bundle found for [codenarc-messages]. Using default messages.

INFO - Report file [C:\test\.sonar\codenarc\report9.xml] created.

CodeNarc completed: (p1=0; p2=0; p3=0) 81ms

INFO - Sensor CodeNarc (done) | time=12286ms

INFO - Sensor GroovySensor

INFO - GMetrics completed: 542ms

INFO - Sensor GroovySensor (done) | time=1091ms

INFO - Sensor Groovy CoberturaSensor

INFO - Analyzing Cobertura report: target/test-reports/cobertura/coverage.xml

INFO - Sensor Groovy CoberturaSensor (done) | time=338ms

INFO - Sensor SCM Sensor

INFO - Sensor SCM Sensor (done) | time=45ms

INFO - Sensor GroovySurefireSensor

INFO - parsing C:\test\target\surefire-reports

WARN - Reports path not found: C:\test\target\surefire-reports

INFO - Sensor GroovySurefireSensor (done) | time=28ms

INFO - Sensor CPD Sensor

INFO - DefaultCpdEngine is used for grvy

INFO - Cross-project analysis disabled

INFO - Sensor CPD Sensor (done) | time=309ms

INFO - No quality gate is configured.

INFO - Compare to previous analysis (2015-09-18)

INFO - Compare over 30 days (2015-08-19, analysis of Tue Sep 15 17:12:33 CEST 2015)

INFO - Execute decorators...

INFO - Store results in database

INFO - Analysis reports generated in 83ms, dir size=9 KB

INFO - Analysis reports compressed in 279ms, zip size=13 KB

INFO - Analysis reports sent to server in 101ms

INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/test

INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.

INFO: EXECUTION SUCCESS

最佳答案

找到了适合我的解决方案。
我可能会帮助其他人:
我最终运行以下命令:

grails test-app unit: -echoOut -coverage -xml -nopost --non-interactive --plain-output --stacktrace --verbose

然后显示覆盖率结果。

祝好运!

关于maven - Sonar 未导入coverage.xml结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32651469/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com