6

刚刚开始为具有“开箱即用”配置的 Java 项目评估 SonarQube 3.7.2,
分析是从 ant 触发的。
一切正常,但在一个大项目中,我得到了 OutOfMemory 异常,即使使用 -Xmx1024M
SonarQube 附带了一个结合了 Findbugs、JaCoCo、Checkstyle 和 PMD 的 Java 质量配置文件。没有找到Quality Profiles > Java Profiles关闭其中一个的任何设置,只有类名模式的过滤器。
是否有可能关闭这些工具或者我必须实现自己的 Java 质量规则?
- 编辑 -
即使在使用了 SonarQube 在线实例的 Java 质量规则中的通用规则之后——意味着只有 10 条规则——我得到了 OutOfMemory 异常。似乎 FindBugs 和 JaCoCo 在异常发生之前运行。如何只运行 fe FindBugs ?
如何完全禁用其中一个插件?从堆栈跟踪中提取:

[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)
4

1 回答 1

7

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

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

于 2013-10-15T20:49:49.173 回答