Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube - how to turn off Findbugs || JaCoCo || Checkstyle || PMD in Java Quality Profile?

Tags:

sonarqube

Just started to evaluate SonarQube 3.7.2 for Java projects with configuration 'out of the box',
analysis is triggered from ant.
All works fine but with one big project i got an OutOfMemory Exception, even with -Xmx1024M
SonarQube ships with a Java Quality Profile that combines Findbugs, JaCoCo, Checkstyle and PMD. Didn't find any setting under Quality Profiles > Java Profiles to turn off one of them, only a filter for classname patterns.
Is there any possibility for turning off those tools or do i have to implement my own Java quality rule ?
--EDIT--
Even after using the common rules from Java Quality Rules of the SonarQube online instance - means only 10 rules - i'm getting OutOfMemory Exception. Seems like FindBugs and JaCoCo where running before the exception occured. How to run f.e. FindBugs only ?
How to disable one of those plugins completely ?? Extract from 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)
like image 946
Rebse Avatar asked Oct 15 '13 19:10

Rebse


1 Answers

Just deactivate all the rules from those tools in your quality profile. See http://docs.codehaus.org/display/SONAR/Quality+Profiles

If you want to disable Findbugs for all projects, you could remove that plugin. See http://docs.codehaus.org/display/SONAR/Update+Center or remove it manually from SONARQUBE_HOME/extensions/plugins and restart your server.

like image 131
David RACODON - QA Consultant Avatar answered Sep 18 '22 12:09

David RACODON - QA Consultant