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

Error caused by: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency #213

Open
SurferL opened this Issue Jan 29, 2019 · 17 comments

Comments

Projects
None yet
8 participants
@SurferL
Copy link

SurferL commented Jan 29, 2019

Hi,

Just started using SonarQube and am trying to integrate with our GitLab, however having issues with what seems to be the GitLab integration.

I am also using GitLab Auth, and have installed the 4.1.0-SNAPSHOT.

Environment:

  • GitLab: 11.7.0-ee
  • SonarQube: 7.6.0.21501
  • GitLab Auth: 1.3.2
  • GitLab integration: 4.1.0-SNAPSHOT
16:45:54.319 INFO: ------------------------------------------------------------------------
16:45:54.319 INFO: EXECUTION FAILURE
16:45:54.319 INFO: ------------------------------------------------------------------------
16:45:54.319 INFO: Total time: 1:07.829s
16:45:54.396 INFO: Final Memory: 19M/281M
16:45:54.397 INFO: ------------------------------------------------------------------------
16:45:54.397 ERROR: Error during SonarQube Scanner execution
org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@4b1d6571:585<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@5a96081a:49<|
	at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:191)
	at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor(ConstructorInjector.java:110)
	at org.picocontainer.injectors.ConstructorInjector.access$100(ConstructorInjector.java:51)
	at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:331)
	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.getLocalInstance(DefaultPicoContainer.java:606)
	at org.picocontainer.DefaultPicoContainer.getComponents(DefaultPicoContainer.java:587)
	at org.sonar.core.platform.ComponentContainer.getComponentsByType(ComponentContainer.java:290)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions(AbstractExtensionDictionnary.java:82)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions(AbstractExtensionDictionnary.java:77)
	at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions(AbstractExtensionDictionnary.java:67)
	at org.sonar.scanner.bootstrap.PostJobExtensionDictionnary.selectPostJobs(PostJobExtensionDictionnary.java:42)
	at org.sonar.scanner.postjob.PostJobsExecutor.execute(PostJobsExecutor.java:38)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:376)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	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:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)

Test .gitlab-ci.yml job:

SonarQube:
  stage: sonar
  image: 
  before_script:
    - apt-get update && apt-get -y install wget unzip
    - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.3.0.1492-linux.zip
    - unzip sonar-scanner-cli-3.3.0.1492-linux.zip
    - export PATH=sonar-scanner-3.3.0.1492-linux/bin:$PATH
  script:
    - sonar-scanner -Dsonar.login=$SONAR_TOKEN -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -X
  tags:
    - docker

Any ideas?

Thanks

@Grannath

This comment has been minimized.

Copy link

Grannath commented Jan 30, 2019

No idea, but I have the same issue. I get it running from Gradle, with just a URL and login defined. So it should not even try to report anything on GitLab. The SonarQube installation is fresh, with just this and the SAML plugin installed.

Environment:

  • GitLab: 11.6.4-ee
  • SonarQube: 7.6 community
  • SAML plugin: 1.1.0.181
  • GitLab integration: 4.0.0
@jangrewe

This comment has been minimized.

Copy link

jangrewe commented Jan 30, 2019

#metoo with SonarQube 7.6 and plugin 4.0.0

> com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@3789da6:466<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@2feae1ab:50<|
@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Can confirm.
SonarQube 7.6 plugin 4.0.0.
Tried compiling latest master version as well, but to no avail. It's peculiar that the unsatisfied dependency is an internal class.

Full stack-trace:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project egsdloen-bc-facade: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@7615666e:512<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@364adb24:56<| -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.6.0.1398:sonar (default-cli) on project egsdloen-bc-facade: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@7615666e:512<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@364adb24:56<|
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@7615666e:512<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@364adb24:56<|
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:67)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.picocontainer.injectors.AbstractInjector$UnsatisfiableDependenciesException: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@7615666e:512<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@364adb24:56<|
    at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor (ConstructorInjector.java:191)
    at org.picocontainer.injectors.ConstructorInjector.getGreediestSatisfiableConstructor (ConstructorInjector.java:110)
    at org.picocontainer.injectors.ConstructorInjector.access$100 (ConstructorInjector.java:51)
    at org.picocontainer.injectors.ConstructorInjector$1.run (ConstructorInjector.java:331)
    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.getLocalInstance (DefaultPicoContainer.java:606)
    at org.picocontainer.DefaultPicoContainer.getComponents (DefaultPicoContainer.java:587)
    at org.sonar.core.platform.ComponentContainer.getComponentsByType (ComponentContainer.java:290)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.completeScannerExtensions (AbstractExtensionDictionnary.java:82)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getExtensions (AbstractExtensionDictionnary.java:77)
    at org.sonar.scanner.bootstrap.AbstractExtensionDictionnary.getFilteredExtensions (AbstractExtensionDictionnary.java:67)
    at org.sonar.scanner.bootstrap.PostJobExtensionDictionnary.selectPostJobs (PostJobExtensionDictionnary.java:42)
    at org.sonar.scanner.postjob.PostJobsExecutor.execute (PostJobsExecutor.java:38)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:376)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:126)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:122)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:73)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:67)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute (BatchIsolatedLauncher.java:46)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke (IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy24.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:185)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:137)
    at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute (ScannerBootstrapper.java:65)
    at org.sonarsource.scanner.maven.SonarQubeMojo.execute (SonarQubeMojo.java:104)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:564)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

I have tried compiling the GitLab plugin with both OpenJDK and OracleJDK 8, both give the same error.

What Java version are you guys using to run the Sonar Scanner?
I'm using OpenJDK 10, could that matter?

@jangrewe

This comment has been minimized.

Copy link

jangrewe commented Jan 30, 2019

On a sidenote, the FindBugs plugin has the same issue with the latest version(s), so i think this is an issue caused by SQ 7.6.

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Found a lead.
@ScannerSide has been deprecated since 7.6 (latest) and a new similar annotation has been created in a different package. Gonna try and use the new annotation and see if that works.

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Can confirm, using the new @ScannerSide annotation works.
Seems like they accidentally broke the functionality when they deprecated it.

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Created a bug-report on SonarSource community:
https://community.sonarsource.com/t/sonarqube-7-6-breaks-sonarside-annotation/6328

@SurferL

This comment has been minimized.

Copy link
Author

SurferL commented Jan 30, 2019

@lukaspj nice find! Any chance you can detail your work fix?

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Sure thing,
Basically just download the source code, find and replace org.sonar.api.batch.ScannerSide with org.sonar.api.scanner.ScannerSide

And update Sonar version in pom.xml to 7.6

Compile and upload and done 👍

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 30, 2019

Worth noting, this isn't a correct fix as such. Because it breaks backwards compatibility with previous versions of SonarQube. It should be fixed by SonarQube itself.

@henryju

This comment has been minimized.

Copy link

henryju commented Jan 31, 2019

Hi @lukaspj

In SonarQube 7.6 we have started getting rid of our historically high coupling with Maven modules. The change that is affecting you is https://jira.sonarsource.com/browse/SONAR-11486

Basically, prior to 7.6, the PostJob extension point was a module level component, but only executed on the root module, at the end of the analysis. Since we are progressively trying to get rid of modules, we have changed the PostJob extension point to a project level component.

In your situation, the problem is that your post job (CommitPublishPostJob) has a dependency on a custom component (ReporterBuilder) and possibly others. Those components are annotated org.sonar.api.batch.ScannerSide which means they are considered as module level components. Since IoC containers form a tree, project level components can't "see" module level ones.

If you want to fix your plugin to support both SQ 7.6 and earlier versions, I think the easiest way is to make all your components project level, but not using the new org.sonar.api.scanner.ScannerSide annotation (as you noticed, it would break compatibility with < 7.6). Instead, you should use the old way, that is still supported: add @InstantiationStrategy(PER_BATCH) on all your components that should be visible to the post job.

Let me know if you need more informations.

@lukaspj

This comment has been minimized.

Copy link

lukaspj commented Jan 31, 2019

@henryju Thanks a ton, your suggested fix seems to work as well. I created a Merge Request in #214 to solve the issue. I'm glad it's not an issue with @ScannerSide as such, but just this specific use of PostJob! :)

@ripper2hl

This comment has been minimized.

Copy link

ripper2hl commented Feb 13, 2019

Same problem 😭

captura de pantalla de 2019-02-13 17-46-06

@n2o

This comment has been minimized.

Copy link

n2o commented Feb 15, 2019

Same error here

ERROR: Error during SonarQube Scanner execution
ERROR: com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob has unsatisfied dependency 'class com.talanlabs.sonar.plugins.gitlab.ReporterBuilder' for constructor 'public com.talanlabs.sonar.plugins.gitlab.CommitPublishPostJob(com.talanlabs.sonar.plugins.gitlab.GitLabPluginConfiguration,com.talanlabs.sonar.plugins.gitlab.SonarFacade,com.talanlabs.sonar.plugins.gitlab.CommitFacade,com.talanlabs.sonar.plugins.gitlab.ReporterBuilder)' from org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@1a20270e:403<[Immutable]:org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer@32daaef2:43<|
@bartlibert

This comment has been minimized.

Copy link

bartlibert commented Feb 15, 2019

@ripper2hl, @N20 have you tried the snapshot mentioned here?

@ripper2hl

This comment has been minimized.

Copy link

ripper2hl commented Feb 16, 2019

yes i used this package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment