SonarQube - 如何关闭Findbugs || JaCoCo || Checkstyle || Java质量简介中的PMD?

时间:2013-10-15 19:58:14

标签: sonarqube

刚刚开始评估SonarQube 3.7.2 for Java项目,配置为“开箱即用”,
从蚂蚁触发分析 一切正常但有一个大项目我得到了OutOfMemory异常,即使使用-Xmx1024M
SonarQube附带了一个Java质量配置文件,它结合了Findbugs,JaCoCo,Checkstyle和PMD。未在Quality Profiles > Java Profiles下找到任何设置来关闭其中一个,只有类名模式的过滤器 是否有可能关闭这些工具或者我是否必须实施自己的Java质量规则? 的 - 编辑 -
即使使用了SonarQube在线实例的Java质量规则中的通用规则 - 仅表示10条规则 - 我得到了OutOfMemory Exception。看起来像FindBugs和JaCoCo在发生异常之前运行。如何运行f.e.仅限FindBugs?
如何完全禁用其中一个插件?从stacktrace中提取:

[sonar:sonar] 12:57:42.689 INFO - Execute Findbugs 2.0.1 done: 888614 ms
[sonar:sonar] 12:57:42.689 INFO - Sensor FindbugsSensor done: 888614 ms
[sonar:sonar] 12:57:42.689 INFO - Sensor InitialOpenIssuesSensor...
[sonar:sonar] 12:57:51.110 INFO - Sensor InitialOpenIssuesSensor done: 8421 ms
[sonar:sonar] 12:57:51.110 INFO - Sensor ProfileSensor...
[sonar:sonar] 12:57:51.189 INFO - Sensor ProfileSensor done: 79 ms
[sonar:sonar] 12:57:51.189 INFO - Sensor ProfileEventsSensor...
[sonar:sonar] 12:57:51.235 INFO - Sensor ProfileEventsSensor done: 46 ms
[sonar:sonar] 12:57:51.235 INFO - Sensor ProjectLinksSensor...
[sonar:sonar] 12:57:51.329 INFO - Sensor ProjectLinksSensor done: 94 ms
[sonar:sonar] 12:57:51.329 INFO - Sensor VersionEventsSensor...
[sonar:sonar] 12:57:51.360 INFO - Sensor VersionEventsSensor done: 31 ms
[sonar:sonar] 12:57:51.360 INFO - Sensor JaCoCoSensor...
[sonar:sonar] 12:57:51.360 INFO - Project coverage is set to 0% as no JaCoCo execution data has been dumped: C:\SCM_BUILD_Sync\scripts\test\target\jacoco.exec
[sonar:sonar] 12:57:58.376 WARN - Coverage information was not collected. Perhaps you forget to include debug information into compiled classes?
[sonar:sonar] 12:57:58.376 INFO - Sensor JaCoCoSensor done: 7016 ms
[sonar:sonar] 12:58:02.110 INFO - Execute decorators...
[sonar:sonar] 13:14:48.597 WARN - [JOURNAL_FLUSHER] WARNING Journal flush operation took 2.101ms last 8 cycles average is 262ms

 ...

Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.<init>(HashMap.java:283)
at java.util.HashMap.<init>(HashMap.java:305)
at com.google.common.collect.HashMultiset.<init>(HashMultiset.java:72)
at com.google.common.collect.HashMultiset.create(HashMultiset.java:42)
at org.sonar.plugins.qi.AbstractViolationsDecorator.countViolationsByPriority(AbstractViolationsDecorator.java:108)
at org.sonar.plugins.qi.AbstractViolationsDecorator.decorate(AbstractViolationsDecorator.java:92)
at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:81)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:72)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:65)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:65)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:65)
at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:65)
at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:57)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:118)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:142)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:187)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:182)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:175)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)

1 个答案:

答案 0 :(得分:6)

只需停用质量配置文件中这些工具的所有规则即可。见http://docs.codehaus.org/display/SONAR/Quality+Profiles

如果要为所有项目禁用Findbugs,可以删除该插件。请参阅http://docs.codehaus.org/display/SONAR/Update+Center或从SONARQUBE_HOME / extensions / plugins中手动删除它,然后重新启动服务器。