Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Support for SonarQube version 6.2 #44

Open
queryholic opened this issue Aug 25, 2017 · 4 comments
Open

[question] Support for SonarQube version 6.2 #44

queryholic opened this issue Aug 25, 2017 · 4 comments

Comments

@queryholic
Copy link

I'm using sonar-qube 6.2 and install this plugin according to the guide README.md.

1. git checkout sonar-5.x  (there is no branch about sonar 6.x, so I use that.)
2. mvn clean install -DskipTests
3. copy this jar to my sonar-qube 6.2 plugins directory.

But, I failed to run analysis using sonar-runner the error message is below.

Error Details

java.lang.IllegalArgumentException: Multiple entries with same key: js=JavaScript and js=JS
	at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150)
	at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104)
	at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70)
	at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254)
	at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166)
	at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140)
	at org.sonar.server.computation.task.projectanalysis.language.LanguageRepositoryImpl.<init>(LanguageRepositoryImpl.java:46)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
	at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
	at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
	at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
	at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
	at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
	at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
	at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
	at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
	at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
	at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
	at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:272)
	at org.sonar.server.computation.task.projectanalysis.step.AbstractComputationSteps.lambda$instances$0(AbstractComputationSteps.java:43)
	at com.google.common.collect.Iterators$8.transform(Iterators.java:799)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
	at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:62)
	at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
	at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84)
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57)
	at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Is this plugin can not support sonarqube 6.x ??

@legolas
Copy link

legolas commented Sep 15, 2017

I have a similar problem, also running sonar 6.2, I got a ClassCastException.
I have only specified sonar.sii.test.ut.ts.report.path and sonar.sii.coverage.ut.ts.report.path.
Here is the top part of the stack trace:

java.lang.ClassCastException: Cannot cast fr.sii.sonar.test.junit.domain.v7.Testsuite to fr.sii.sonar.test.junit.domain.v7.Testsuites
	at java.lang.Class.cast(Class.java:3369)
	at fr.sii.sonar.report.core.common.provider.XmlFileReportProvider.get(XmlFileReportProvider.java:145)
	at fr.sii.sonar.report.core.common.provider.FallbackProvider.get(FallbackProvider.java:37)
	at fr.sii.sonar.report.core.common.ReportSensor.analyse(ReportSensor.java:106)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)```

@legolas
Copy link

legolas commented Sep 15, 2017

And here is another where i have disabled the sonar.sii.test.ut.ts.report.path setting:

fr.sii.sonar.report.core.common.exception.SaveException: The file /var/lib/****/workspace/PR02-news-and-events-app-QA/frontend/src/main/frontend/src/test.ts doesn't exist
	at fr.sii.sonar.report.core.common.util.FileUtil.checkMissing(FileUtil.java:239)
	at fr.sii.sonar.report.core.common.util.FileUtil.checkMissing(FileUtil.java:106)
	at fr.sii.sonar.report.core.coverage.save.CoverageSaver.saveCoverage(CoverageSaver.java:116)
	at fr.sii.sonar.report.core.coverage.save.CoverageSaver.save(CoverageSaver.java:56)
	at fr.sii.sonar.report.core.coverage.save.CoverageSaver.save(CoverageSaver.java:34)
	at fr.sii.sonar.report.core.common.ReportSensor.analyse(ReportSensor.java:106)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)

The file src/main/frontend/src/test.ts is part of sonar.exclusions option.

@legolas
Copy link

legolas commented Sep 18, 2017

And again another one related to tslint with json as report format:

INFO: Sensor TslintQualitySensor
ERROR: failed to parse json file. Cause: Can not deserialize instance of fr.sii.sonar.report.core.quality.domain.report.QualityReport out of START_ARRAY token
 at [Source: java.io.InputStreamReader@288728e; line: 1, column: 1]
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.299s
INFO: Final Memory: 50M/417M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Cannot parse report /var/lib/****/workspace/PR02-news-and-events-app-QA/frontend/target/sonar/ts-lint.json
	at fr.sii.sonar.report.core.common.ReportSensor.analyse(ReportSensor.java:109)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:57)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:49)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:182)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:247)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:242)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:240)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:232)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
	at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
	at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
	at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:74)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: fr.sii.sonar.report.core.common.exception.ProviderException: failed to parse json file. Cause: Can not deserialize instance of fr.sii.sonar.report.core.quality.domain.report.QualityReport out of START_ARRAY token
 at [Source: java.io.InputStreamReader@288728e; line: 1, column: 1]
	at fr.sii.sonar.report.core.common.provider.JsonFileReportProvider.get(JsonFileReportProvider.java:55)
	at fr.sii.sonar.report.core.common.ReportSensor.analyse(ReportSensor.java:106)
	... 30 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of fr.sii.sonar.report.core.quality.domain.report.QualityReport out of START_ARRAY token
 at [Source: java.io.InputStreamReader@288728e; line: 1, column: 1]
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
	at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:854)
	at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:850)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1257)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:155)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:134)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3731)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2778)
	at fr.sii.sonar.report.core.common.provider.JsonFileReportProvider.get(JsonFileReportProvider.java:51)
	... 31 more
111

@DavidGDD
Copy link

@dbsejr21 The problem reported is because you have two plugins for Javascript, this one and the SonarJS. I've solved the problem uninstalling the SonarJS y SonarTS.

But now i'm stacked trying to get the sonar scanner issues in the sonarqube. I think the project may be unmainteined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants