Error messsage as required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin: java/util/jar/Pack200


I recently subscribed to Sonarcloud paid version. But I am unable to analyze my project using sonarcloud. I keep getting following error:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project TGService: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin: failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin: java/util/jar/Pack200

Could you please help on how to resolve this issue?



On what CI are you running the scanner ?
Does it work locally ? And does your build task work without the sonar command ?

I subscribed to SonarCloud paid version. I integrated this with gitlab.
The code compiles and build is generated successfully in my local. I am able to run the application as well.

Even I tried with other cloud tools like Codacy. I am able to get the code analysis done. But the same is not working with Sonarcloud.

Hope this information is helpful to suggest the solution.

Here are additional logs:
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/root/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/
[ERROR] urls[1] = file:/root/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/root/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.2.1/plexus-utils-3.2.1.jar
[ERROR] urls[4] = file:/root/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/
[ERROR] urls[5] = file:/root/.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]]

Best Regards
Gowtham TG

This is most likely due to the removal of java/util/jar/Pack200 in JDK14. You could downgrade to JDK13 until sonarsource releases a new plugin version.


Can you please share the steps on how to to do that? As I mentioned earlier I am using “Sonarcloud” version.


Hi. I have the same problem. I have spring application written with kotlin, then i created gitlab-ci.

I have my source code here:

In file gitlab-ci.yml is CI configuration.

And there is a log from this analysis from CI step:

Does anyone has any idea?

Your build uses the maven:latest image:

  image: maven:latest

This image comes with JDK14; you could switch to maven:3.6.3-jdk-11.

  image: maven:3.6.3-jdk-11

Hi Andreas,

I am using JDK 8 and using following maven versions:

And the POM model version is this:

Can you please suggest on where to change this? Can you please also extend the trail version, so that I can make these checks?


You should do the change mentioned by @andreask in your .gitlab-ci.yml file.

1 Like

Thank you very much. It worked now.

Best Regards

Also, it works. Thank You :slight_smile: