我正在使用Sonar eclipse插件版本3.1.1.20130521-1304-RELEASE。
当我从插件运行本地分析时,控制台看起来像
INFO: Sonar Server 3.5.1 17:15:41.103 INFO - Load batch settings 17:15:41.617 INFO - User cache: 17:15:41.630 INFO - Install plugins 17:15:41.854 INFO - Exclude plugins: devcockpit, pdfreport, views, report, scmactivity 17:15:47.571 INFO - ------------- Executing Project Scan 17:15:49.494 INFO - Apply project exclusions 17:15:49.494 INFO - Dry run 17:15:53.028 INFO - Create JDBC datasource for 17:15:54.094 INFO - Initializing Hibernate 17:15:59.013 INFO - ------------- Inspecting DPortal 17:15:59.045 INFO - Load module settings 17:16:00.721 INFO - Quality profile : [name=,language=java] 17:16:00.819 INFO - Excluded tests: 17:16:00.820 INFO - **/package-info.java 17:16:00.911 INFO - Configure Maven plugins 17:16:01.077 INFO - Compare to previous analysis (2013-06-03) 17:16:01.135 INFO - Compare over 5 days (2013-05-29, analysis of 2013-06-03 04:32:51.903) 17:16:01.168 INFO - Compare over 30 days (2013-05-04, analysis of 2013-06-03 04:32:51.903) 17:16:02.333 INFO - Base dir: 17:16:02.333 INFO - Working dir: 17:16:02.333 INFO - Source dirs: 17:16:02.334 INFO - Test dirs: 17:16:02.338 INFO - Binary dirs: 17:16:02.338 INFO - Source encoding: windows-1252, default locale: en_US 17:19:58.735 WARN - SCM URL must not be blank. SCM Stats Plugin will not run.Please check the parameter SCM URL or the <scm> section of Maven pom.
我不确定为什么它会等待3分钟。
如果我可以对特定的src目录(来自maven POM的子模块)而不是整个项目运行本地分析,那就太好了。我有办法吗?
更新 我只对违规行为感兴趣。我可以强制本地分析跳过其他插件吗?
更新2: 我尝试在eclipse工作区设置中设置@fabrice提到的本地分析属性。
但它似乎只从下面的Sonar控制台日志中获取了一些属性。
其他像sonar.importSources它只是忽略了?
此外,它似乎并不尊重项目特定属性sonar.includeModules设置为单个模块。它仍然使用所有src目录。
INFO: Sonar Server 3.5.1 13:16:35.022 INFO - Load batch settings 13:16:35.413 INFO - User cache: 13:16:35.421 INFO - Install plugins 13:16:35.653 INFO - Exclude plugins: devcockpit, pdfreport, views, report, buildstability, scmactivity, buildbreaker 13:17:50.854 INFO - ------------- Executing Project Scan 13:17:51.908 INFO - Apply project exclusions 13:17:51.924 INFO - Dry run 13:17:54.506 INFO - Create JDBC datasource for jdbc:h2: 13:17:55.342 INFO - Initializing Hibernate 13:17:59.932 INFO - ------------- Inspecting DPortal 13:17:59.938 INFO - Load module settings 13:18:03.169 INFO - Quality profile : [name=Dportal Alert Thresholds,language=java] 13:18:03.173 INFO - Excluded tests: 13:18:03.174 INFO - **/package-info.java 13:18:03.251 INFO - Configure Maven plugins 13:18:03.397 INFO - Compare to previous analysis (2013-06-04) 13:18:03.447 INFO - Compare over 5 days (2013-05-31, analysis of 2013-06-04 12:57:34.79) 13:18:03.498 INFO - Compare over 30 days (2013-05-06, analysis of 2013-06-04 12:57:34.79) 13:18:07.592 INFO - Base dir: 13:18:07.592 INFO - Working dir: 13:18:07.593 INFO - Source dirs: 13:18:07.595 INFO - Test dirs: 13:18:07.601 INFO - Binary dirs: 13:18:07.602 INFO - Source encoding: UTF-8, default locale: en_US 13:22:13.356 INFO - Sensor JavaSourceImporter... 13:23:35.056 INFO - Sensor JavaSourceImporter done: 81700 ms 13:23:35.057 INFO - Sensor JavaSquidSensor... 13:24:53.888 INFO - Java AST scan... 13:28:08.900 INFO - Java AST scan done: 195012 ms 13:28:10.152 INFO - Sensor JavaSquidSensor done: 275095 ms 13:28:10.152 INFO - Sensor FindbugsSensor... 13:28:10.152 INFO - Execute Findbugs 2.0.1... 13:28:42.363 INFO - Findbugs output report:
答案 0 :(得分:2)
Eclipse Sonar插件的新版本是:3.2.0.20130627-1142-RELEASE
我们遇到了类似的问题。默认列表没有足够的覆盖范围。 这是我们使用的值(它禁用所有SCM插件):
注意:
如果控制台输出或Sonar设置屏幕报告了一般用户的声纳插件名称,那将是很好的,因为我们是运行本地分析的人...
答案 1 :(得分:1)
看起来你的SCM Stats插件存在问题。删除它,这应该完美。 (服务器端的所有内容都可能正常,但这并不意味着插件将在批处理方面执行而没有任何错误)
如果只想在某些子模块上运行分析,则应使用“sonar.skippedModules”属性。请参阅http://docs.codehaus.org/display/SONAR/Analysis+Parameters
要从dryRun分析中包含/排除插件,您可以使用以下属性(以逗号分隔的插件键列表):