wttech / AEM-Rules-for-SonarQube

SonarQube plugin with set of rules detecting possible bugs and bad smells specific for AEM development.
Apache License 2.0
116 stars 50 forks source link

SonarQube 8.9 LTS #213

Closed jlentink closed 2 years ago

jlentink commented 3 years ago

SonarQube 8.9LTS and AEM rules 1.3 are triggering an error when performing a sonarQube maven scan.

[ERROR] Failed to execute goal sonar (default-cli) on project xxxx.parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
toniedzwiedz commented 3 years ago

Hi @jlentink,

thanks for reporting this. Is this the full stack trace? It looks like an issue with runtime dependencies but it's not something I've seen before. I've got a few questions to help isolate the issue:

  1. Does this happen regardless of what project you scan or is just one affected?
  2. Can you share the code you're scanning? If not, can you provide an anonimized example which allows this to be reproduced upon scan?

Regards, Tomek

jlentink commented 3 years ago

Hi @toniedzwiedz,

Unfortunately, I cannot share the code. But here is the full error

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal sonar:sonar (default-cli) on project projectname.parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
[ERROR] urls[1] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/Users/utopia/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
[ERROR] urls[5] = file:/Users/utopia/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/PluginContainerException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :projectname.parent
jlentink commented 3 years ago

Did a run with -X for even more detail:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:37 min
[INFO] Finished at: 2021-05-07T18:02:05+05:30
[INFO] Final Memory: 127M/1659M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project akzonobel.parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.7.0.1746
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
[ERROR] urls[1] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/Users/utopia/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
[ERROR] urls[5] = file:/Users/utopia/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] 
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project akzonobel.parent: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.7.0.1746
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
urls[1] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/Users/utopia/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
urls[5] = file:/Users/utopia/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    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:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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.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.PluginExecutionException: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.7.0.1746
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
urls[1] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/Users/utopia/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
urls[5] = file:/Users/utopia/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:183)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    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:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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.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.PluginContainerException: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:3.7.0.1746
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
urls[1] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[2] = file:/Users/utopia/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[3] = file:/Users/utopia/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
urls[4] = file:/Users/utopia/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
urls[5] = file:/Users/utopia/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:181)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    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:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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.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: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
    at com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.visitNode (AdministrativeAccessUsageCheck.java:85)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$visit$6 (VisitorsBridge.java:287)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$forEach$9 (VisitorsBridge.java:303)
    at org.sonar.java.model.VisitorsBridge.runScanner (VisitorsBridge.java:159)
    at org.sonar.java.model.VisitorsBridge.access$100 (VisitorsBridge.java:62)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.forEach (VisitorsBridge.java:303)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:289)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren (VisitorsBridge.java:273)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit (VisitorsBridge.java:293)
    at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.run (VisitorsBridge.java:264)
    at org.sonar.java.model.VisitorsBridge.visitFile (VisitorsBridge.java:139)
    at org.sonar.java.ast.JavaAstScanner.simpleScan (JavaAstScanner.java:127)
    at org.sonar.java.ast.JavaAstScanner.scan (JavaAstScanner.java:79)
    at org.sonar.java.JavaSquid.scanSources (JavaSquid.java:130)
    at org.sonar.java.JavaSquid.scan (JavaSquid.java:116)
    at org.sonar.plugins.java.JavaSquidSensor.execute (JavaSquidSensor.java:105)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse (AbstractSensorWrapper.java:48)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:85)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1 (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy (ModuleSensorsExecutor.java:77)
    at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute (ModuleSensorsExecutor.java:59)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart (ModuleScanContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan (ProjectScanContainer.java:392)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:388)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively (ProjectScanContainer.java:385)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart (ProjectScanContainer.java:357)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart (GlobalContainer.java:150)
    at org.sonar.core.platform.ComponentContainer.startComponents (ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute (ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute (Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute (Batch.java:66)
    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.$Proxy29.execute (Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute (EmbeddedScanner.java:189)
    at org.sonarsource.scanner.api.EmbeddedScanner.execute (EmbeddedScanner.java:138)
    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:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    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:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    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.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/PluginContainerException
jlentink commented 3 years ago

Disabling AEM-11 is a good workaround for this issue.

nomorehugs commented 3 years ago

I have the same issue. @jlentink thanks for the workaround!

youngroman commented 3 years ago

same problem here, after upgrading from SonarQube 7.x to 8.9.0. I am using the sonar-scanner-cli, so no Maven involved. it happens with every java project.

what I did: download SQ 8.9 + unpack it download aem-plugin and put it into extensions/plugins start SQ extend default java quality profile with all AEM rules, make the new quality profile the default do a scan with sonar-scanner-cli of any project with at least 1 java file inside.

here is my stack-trace (similar to the one above): ERROR: Error during SonarScanner execution java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z at com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.visitNode(AdministrativeAccessUsageCheck.java:85) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$visit$6(VisitorsBridge.java:287) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.lambda$forEach$9(VisitorsBridge.java:303) at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:159) at org.sonar.java.model.VisitorsBridge.access$100(VisitorsBridge.java:62) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.forEach(VisitorsBridge.java:303) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:289) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visitChildren(VisitorsBridge.java:273) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.visit(VisitorsBridge.java:293) at org.sonar.java.model.VisitorsBridge$IssuableSubsciptionVisitorsRunner.run(VisitorsBridge.java:264) at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:139) at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:127) at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:79) at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:130) at org.sonar.java.JavaSquid.scan(JavaSquid.java:116) at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:105) at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85) at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59) at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59) at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123) at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:392) at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:388) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:357) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123) at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:150) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) 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:189) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) at org.sonarsource.scanner.cli.Main.execute(Main.java:112) at org.sonarsource.scanner.cli.Main.execute(Main.java:75) at org.sonarsource.scanner.cli.Main.main(Main.java:61)

I had a custom plugin developed by myself with exactly the same problem. I upgraded sonar-plugin-api to 8.9.0.43852 and sonar-java-plugin to 6.15.1.26025, did a rebuild of my plugin and it worked. since I only need my plugin to work in 8.9.0 I did not look into compatibility stuff, so I did not check in which version of sonar-java-plugin the API change was done and which sonar-plugin-api version is compatible with that. I simply went with the versions that are used in 8.9.0 LTS.

ricardojdsilva87 commented 3 years ago

Hello, We had the same issue after upgrading from sonarqube 8.6.0 to the latest lts version (8.9.1).

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project daimler-embxp: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar: java.lang.NoSuchMethodError: com.cognifide.aemrules.java.checks.AdministrativeAccessUsageCheck.hasSemantic()Z
SiarheiTsytrykau commented 3 years ago

Hello, we had the same issue

francois-ouellet commented 3 years ago

Same issue here too.

strmecki commented 3 years ago

Same issue. @toniedzwiedz any plans to create a new release compatible with the latest versions of SonarQube?

ksnehi commented 3 years ago

Same issue here as well. Any plans of releasing a new version of AEM rules plugin to fix this?

jwadolowski commented 2 years ago

We've just upgraded to SonarQube 8.9.4 (the most recent LTS version) and came across the same problem.

apelluru commented 2 years ago

Hope pull request https://github.com/wttech/AEM-Rules-for-SonarQube/pull/216 will solve the issue

ondrejkulich commented 2 years ago

Any updates about this issue?

inedoviesov1 commented 2 years ago

Found an issue in Sonar Jira https://jira.sonarsource.com/browse/SONARJAVA-3793 I've just checked a PR with Sonar v8.9.7, it works fine. Could you please provide an update when we could expect a new release of AEM Rules plugin, because we are planing an upgrade of Sonar and we don't want to disable these checks. Thanks

apelluru commented 2 years ago

Is this project still active?

toniedzwiedz commented 2 years ago

Hi @ashokmca07 , it's not actively developed, more of a maintenance mode. Thanks for the pull request. I'll test the changes and get a version released by the end of the week.

toniedzwiedz commented 2 years ago

@ashokmca07 the tests pass locally for me, but I'll need to check this against a couple versions of the JDK and SonarQube. This was originally automated via TravicCI but there have been changes in how Travis operates so I'll need to get each PR to trigger a CI build first. I think I can quickly migrate to GitHub actions but that's something I'll have to pick up next week. Apologies for the further delay.

apelluru commented 2 years ago

@ashokmca07 the tests pass locally for me, but I'll need to check this against a couple versions of the JDK and SonarQube. This was originally automated via TravicCI but there have been changes in how Travis operates so I'll need to get each PR to trigger a CI build first. I think I can quickly migrate to GitHub actions but that's something I'll have to pick up next week. Apologies for the further delay.

@toniedzwiedz thanks for your support

toniedzwiedz commented 2 years ago

@ashokmca07 I'm testing out a few more scenarios, analysing a couple of real project. I noticed that you used version 7.6 of the Java plugin https://github.com/wttech/AEM-Rules-for-SonarQube/pull/218/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8R109 and I may have jumped the gun mirroring this in the requirements https://github.com/wttech/AEM-Rules-for-SonarQube/pull/221/files Now I'm getting an error on startup

java.lang.IllegalStateException: Unable to load installed plugins
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:40)
        at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
        at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
        at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
        at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
        at org.picocontainer.behaviors.Stored.start(Stored.java:110)
        at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
        at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
        at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
        at org.sonar.ce.container.ComputeEngineContainerImpl.startLevel2(ComputeEngineContainerImpl.java:215)
        at org.sonar.ce.container.ComputeEngineContainerImpl.start(ComputeEngineContainerImpl.java:185)
        at org.sonar.ce.ComputeEngineImpl.startup(ComputeEngineImpl.java:45)
        at org.sonar.ce.app.CeServer$CeMainThread.attemptStartup(CeServer.java:163)
        at org.sonar.ce.app.CeServer$CeMainThread.run(CeServer.java:141)
Caused by: org.sonar.updatecenter.common.exception.IncompatiblePluginVersionException: The plugin 'java' is in version 6.15.1.26025 whereas the plugin 'aemrules' requires a least a version 7.6.
        at org.sonar.updatecenter.common.PluginReferential.addOutgoingDependency(PluginReferential.java:115)
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.lambda$fromPluginManifests$0(PluginReferentialManifestConverter.java:55)
        at java.base/java.lang.Iterable.forEach(Unknown Source)
        at org.sonar.updatecenter.common.PluginReferentialManifestConverter.fromPluginManifests(PluginReferentialManifestConverter.java:51)
        at org.sonar.server.plugins.PluginReferentialMetadataConverter.getInstalledPluginReferential(PluginReferentialMetadataConverter.java:45)
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.init(InstalledPluginReferentialFactory.java:54)
        at org.sonar.server.plugins.InstalledPluginReferentialFactory.start(InstalledPluginReferentialFactory.java:38)
        ... 14 common frames omitted

The Docker image for SonarQube 8.9 comes with version 6.15, which is where this change was made https://jira.sonarsource.com/browse/SONARJAVA-3793

I think it's fine to compile against a newer verison, but I'll leave 6.15 as a requirement.

Surprisingly, the CI script that I introduced didn't pick this up. I was hoping to reuse the same method the SonarQube team is using in their tests https://github.com/SonarSource/docker-sonarqube/blob/master/run-tests.sh#L58 but it seems the /api/system/status endpoint reports that SonarQube is up in spite of the plugin failing to load. I need to improve the check so that we have a quick way of verifying this automatically.

http://localhost:9000/api/plugins/available or http://localhost:9000/api/plugins/installed could be a better fit

youngroman commented 2 years ago

a while ago I fell into the same trap in one of my custom plugins. back then I discovered that a sonarQubeMinVersion of 8.9 enforces sonar-java 7.6 the latest sonarQubeMinVersion that does not enforce sonar-java 7.6 is 8.4, so using <sonarQubeMinVersion>8.4</sonarQubeMinVersion> should fix that.

toniedzwiedz commented 2 years ago

@youngroman it's odd, because I'm using the Docker image for SonarQube Community 8.9 (sonarqube:8.9-community) and, according to the startup log, it has the plugin 'java' installed in version 6.15.1.26025 (see the output in one of my last posts). If I'm not mistaken, this means that either the image is wrong, or there is compatibility.

It could be possible to support 8.4 and higher. For now, I'll try a combination of java:6.15 and SonarQube 8.9 LTS and see how the improved tests pass.

apelluru commented 2 years ago

Exactly local/CI tests are always green. let me also take a look at the combination of java:6.15 and SonarQube 8.9 LTS Local tests with docker (8.9 sonar community version):


[info] localaemrulessonarqube: waiting for web server to start ...
[info] localaemrulessonarqube: waiting for web server to start ...
[info] localaemrulessonarqube: waiting for web server to start ...
HTTP/1.1 200
[info] localaemrulessonarqube: waiting for sonarqube to be ready ...
[info] localaemrulessonarqube: waiting for sonarqube to be ready ...
[info] localaemrulessonarqube: waiting for sonarqube to be ready ...
[info] localaemrulessonarqube: waiting for sonarqube to be ready ...
{"id":"BF41A1F2-AX__o9IIvCvgEsth17C_","version":"8.9.8.54436","status":"UP"}
[info] localaemrulessonarqube: OK !
[info] localaemrulessonarqube: stopping container: f043fd9becd3ae76af35e68dee7d0cc8e39f3331a2082ee4e84828c0f7725f6e
f043fd9becd3ae76af35e68dee7d0cc8e39f3331a2082ee4e84828c0f7725f6e
localaemrulessonarqube => success```
toniedzwiedz commented 2 years ago

@ashokmca07 they no longer are after the recent improvement https://github.com/wttech/AEM-Rules-for-SonarQube/runs/5855142958?check_suite_focus=true

Mind you, that test only gives us assurance that there aren't serious dependency conflicts that would prevent the server from starting up (which is something we've seen with SonarQube 7.9 in the past). To test the original issue this thread is actually about, we need to perform an analysis at runtime, with a quality profile that has AEM-11 enabled. I've reproduced the error in a version without your fix so I've got a good reference point.

For now, none of the automated tests covers this scenario (unit tests just use the java plugin version declared in the pom.xml while the startup tests just check if rules can be loaded) so this means I'll have to do a manual test.

Automation of actual analysis at runtime should be possible but it's not a scenario I can quickly cover.

toniedzwiedz commented 2 years ago

https://github.com/wttech/AEM-Rules-for-SonarQube/pull/224 has a version that passes the improved tests, i.e. we know that AEM Rules have been installed. I'll test this version manually, if AEM-11 can be used without throwing errors, I think we have a release candidate :)

toniedzwiedz commented 2 years ago

AEM-11 appears to work with the version from #224, I'll perform a release today and raise a PR to get it into the SonarQube marketplace

toniedzwiedz commented 2 years ago

Release 1.6, compatible with SonarQube 8.9 LTS has been made available in the SonarQube marketplace. For sources and binary downloads, check https://github.com/wttech/AEM-Rules-for-SonarQube/releases/tag/v1.6

Many thanks to @ashokmca07 for the contribution and apologies for the long wait.

apelluru commented 2 years ago

@toniedzwiedz Thanks a lot for your help and quick releases to SonarQube marketplace

ksnehi commented 2 years ago

Thanks @ashokmca07 and @toniedzwiedz for resolving this long pending issue and releasing a newer version, much appreciated!