Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube 7.8 , Maven 3.8.2, Sonar Scanner 3.7.0.1746 )
  • what are you trying to achieve :- Analysing the code quality
  • what have you tried so far to achieve this :- Package has been created in maven and when I’m giving mvn sonar:sonar facing below an error. Went to similar post & changing plugin version but didn;t help.
    ( Jave version :- openjdk 11.0.9.1 2020-11-04 on Mac )
[INFO] ------------- Run sensors on module maven-stanalone-application
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=655ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.617 s
[INFO] Finished at: 2021-09-25T08:06:09+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project maven-stanalone-application: 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.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugi>org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/pradeepsingh/Desktop/maventest/org/sonarsource/scanner/maven/sonar-maven-plugin/3.7.0.1746/sonar-maven-plugin-3.7.0.1746.jar
[ERROR] urls[1] = file:/Users/pradeepsingh/Desktop/maventest/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/Users/pradeepsingh/Desktop/maventest/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/Users/pradeepsingh/Desktop/maventest/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/Users/pradeepsingh/Desktop/maventest/org/sonarsource/scanner/api/sonar-scanner-api/2.14.0.2002/sonar-scanner-api-2.14.0.2002.jar
[ERROR] urls[5] = file:/Users/pradeepsingh/Desktop/maventest/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] : java.lang.reflect.InaccessibleObjectException-->Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @5ab63a04
[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

pom.txt (3.2 KB)

Hi,

Welcome to the community!

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.8 → 7.9.6 → 8.9.2 → 9.1 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

Once you’ve upgraded, you should be able to analyze using Java 11.

 
HTH,
Ann

Hi Ann,

Thank you for your response here.

I have installed java version “1.8.0_301” and other colleagues not facing same issue despite of same maven/java version.
Can you check & let me know please?

Hi,

Sorry, I really can’t. 7.8 is very old and very unsupported.

 
Ann

yeah it’s worked after upgrading to 8.9.2.
But now I’m seeing below error

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project maven-enterprise-application: Unable to load component class org.sonar.scanner.bootstrap.ScannerPluginInstaller: Unable to load component class org.sonar.scanner.bootstrap.PluginFiles: Unable to load component class org.sonar.scanner.bootstrap.GlobalConfiguration: Unable to load component class org.sonar.scanner.bootstrap.GlobalServerSettings: Unable to load settings: Protocol message end-group tag did not match expected tag. → [Help 1]

and this as well

ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar (default-cli) on project MavenEnterpriseApp-ear: Maven session does not declare a top level project → [Help 1]

Hi,

Those are new questions. They deserve new threads (with full stacktraces)

 
Ann