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

scala key duplicated #31

Closed
edwelker opened this issue Feb 18, 2016 · 17 comments
Closed

scala key duplicated #31

edwelker opened this issue Feb 18, 2016 · 17 comments

Comments

@edwelker
Copy link

Hi there, and thanks for the wonderful plugin! If I knew anything about this domain, I'd try to write a pull request, but I don't. :(

Anyway, I ran across the following issue, which I actually found a Stack Overflow and Sonar ticket relating to.

http://stackoverflow.com/questions/35310698/sonarqube-background-tasks-failing-with-multiple-entries-with-same-key
and
https://jira.sonarsource.com/browse/SONAR-7318

The core problem seems to be:

java.lang.IllegalArgumentException: Multiple entries with same key: scala=Scala and scala=Scala

Thanks!

@RadoBuransky
Copy link
Owner

Thanks for letting me know. It looks like I will have to fix it soon.

@edwelker
Copy link
Author

No problem. I'd have gone to the other authors, but you were the most responsive. :)

Also, I naively tried to compile a version (of the other plugins) that changed the key, but then Sonar-runner complained that there were two keys matching the same *.scala file-match pattern, so I gave up at that point.

@RadoBuransky
Copy link
Owner

I started looking at the problem, but I cannot reproduce it. I use SonarQube 5.3, latest Scalastyle (I built it locally) and latest Scoverage plugin (5.1). What's your configuration? Would it be possiblefor you to upgrade to latest versions too?

@rantonucci-lo
Copy link

I am seeing this problem. I am using

  • SonarQube 5.3
  • Scalastyle via scalastyle-sbt-plugin 0.8.0
  • Scoverage via sbt-scoverage 1.3.5
  • Scalastyle Sonar plugin via emrehan's sonar-scalastyle 0.0.1-SNAPSHOT released 7/14/2014
  • your Scoverage Sonar plugin 5.1.2

@djsecilla
Copy link

FWIW I am hitting the same problem with:

  • SonarQube 5.2
  • Scalastyle via scalastyle-sbt-plugin 0.7.0
  • Scoverage via sbt-scoverage 1.3.1
  • Scoverage Sonar plugin 5.1.2
  • Scalastyle Sonar plugin sonar-scalastyle-0.0.3-SNAPSHOT built locally from NCR-CoDE github

@RadoBuransky
Copy link
Owner

Thanks guys, I'll give it another try.

@orium
Copy link

orium commented Apr 6, 2016

I have the same problem with Sonar 5.4. Any news on this issue?

@antonioalegria
Copy link

I'm also experiencing this issue with Sonar 5.4 and sbt-scoverage 1.3.5, as well as all the latest versions of Sonar, Scoverage and Scalastyle plugins.

@RadoBuransky
Copy link
Owner

this looks like a beautiful rainy night to close this thing for good...stay tuned

@rleibman
Copy link

rleibman commented Apr 8, 2016

ok, so I played some with it this week and just ended up more confused.
As far as I can tell, there's at least 3 different sonar plugins for
scala, but there's so many forks that it's hard to say which one to use.

  • One that does scala itself (and apparently under some versions does
    scapegoat)
  • One does scoverage
  • One does scalastyle

I tried to use different combinations and different forks of the above
with very little success. It would be awesome to have a consistent set
of plugin combinations that works

Thanks for the hard work, and I'd be glad to test it when you have
something.

Roberto

On 04/08/2016 09:42 AM, Rado Buranský wrote:

this looks like a beautiful rainy night to close this thing for
good...stay tuned


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#31 (comment)

@RadoBuransky
Copy link
Owner

The situation is that there is NO Scala plugin for Sonar yet. I would be extremely happy if anyone of you had the time to merge these into one.

@RadoBuransky
Copy link
Owner

Issue reproduced by running anaylsis run on the SBT multi-module sample:

  • Sonar 5.4
  • Scoverage Sonar plugin 5.1.2
  • Scalastyle Sonar plugin sonar-scalastyle-0.0.3-SNAPSHOT built locally from [NCR-CoDE github]

Error message:

2016.04.08 19:38:26 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVP29BItZxf78BIhXOvO
java.lang.IllegalArgumentException: Multiple entries with same key: scala=Scala and scala=Scala
    at com.google.common.collect.ImmutableMap.checkNoConflict(ImmutableMap.java:150) ~[guava-17.0.jar:na]
    at com.google.common.collect.RegularImmutableMap.checkNoConflictInBucket(RegularImmutableMap.java:104) ~[guava-17.0.jar:na]
    at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:70) ~[guava-17.0.jar:na]
    at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:254) ~[guava-17.0.jar:na]
    at com.google.common.collect.Maps.uniqueIndex(Maps.java:1166) ~[guava-17.0.jar:na]
    at com.google.common.collect.Maps.uniqueIndex(Maps.java:1140) ~[guava-17.0.jar:na]
    at org.sonar.server.computation.language.LanguageRepositoryImpl.<init>(LanguageRepositoryImpl.java:46) ~[sonar-server-5.4.jar:na]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_80]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_80]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_80]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_80]
    at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) ~[picocontainer-2.15.jar:na]
    at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678) ~[picocontainer-2.15.jar:na]
    at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:265) ~[sonar-core-5.4.jar:na]
    at org.sonar.server.computation.step.AbstractComputationSteps$1.apply(AbstractComputationSteps.java:43) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.step.AbstractComputationSteps$1.apply(AbstractComputationSteps.java:40) ~[sonar-server-5.4.jar:na]
    at com.google.common.collect.Iterators$8.transform(Iterators.java:794) ~[guava-17.0.jar:na]
    at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48) ~[guava-17.0.jar:na]
    at org.sonar.server.computation.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:37) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.report.ReportTaskProcessor.process(ReportTaskProcessor.java:72) ~[sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:80) [sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:55) [sonar-server-5.4.jar:na]
    at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:34) [sonar-server-5.4.jar:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_80]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_80]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_80]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_80]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80]

@RadoBuransky
Copy link
Owner

Here is the released plugin. Enjoy and break it again. Thanks a lot to all of you and sorry for letting you waiting so long.
https://github.com/RadoBuransky/sonar-scoverage-plugin/releases/tag/v5.1.3

@rleibman
Copy link

rleibman commented Apr 8, 2016

So... I've got the latest version of sonar, with your plugin and the scalastyle plugin.. in a similar environment to yours.

I then run, in my project:
sbt clean scalastyle coverage test sonar

It all runs fine, with no errors I can see (details available if you want them)

And yet, the only thing I see in the sonar server is the project, but no data relating to style or coverage, in fact... it says there's no LOCS. Did I miss something?

@RadoBuransky
Copy link
Owner

@rleibman I don't know but it sounds like a different issue anyway.

@orium
Copy link

orium commented Apr 9, 2016

Thanks @RadoBuransky. It is working now :)

@joncrocks
Copy link

@rleibman You may in fact not be doing anything wrong, but it's worth noting that I don't think this plugin gives a LOC count, meaning it's quite possible to get a LOC count of 0 for 'Scala'. You need some kind of 'Scala language' plugin for that, but again, you'll end up with conflicts over which plugin defines what 'Scala' is.

@RadoBuransky I did hack together my own 'Scalastyle + Scoverage' 'uber' plugin a little while ago, by essentially fiddling the dependencies and only defining 'Scala' once, was hacky, but did work. Might have a second go-around with something a bit more formal. Looked at https://github.com/Stratio/sonar-scala-plugin as well for more scala language metrics. Thanks for your hard work!

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

8 participants