Docker sonnar scanner cli - Java 17 support

Hi,

I have a question regarding the docker sonar scanner cli image: GitHub - SonarSource/sonar-scanner-cli-docker: Docker image for SonarScanner CLI

We can see there is a new branch for Java 17 support: feature/mc/new-docker-image-sonarcloud.

Is there any timeline when this will be released in dockerhub?

Thx & BR,
Alex

Hey there.

No timeline on this feature for now (I think it was a POC).

Can you clarify what you’re expecting out of Java 17 support, or what about Java 11 support is limiting you when using this docker image?

Thank you for your response.

My colleague enabled a plugin for - I think - custom rule sets and the scanner in our gitlab pipeline (using the docker image) now throws:

ERROR: Error during SonarScanner execution

53org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.sonarsource.scanner.api.internal.IsolatedClassloader@76a4ebf2-org.sonar.scanner.bootstrap.ScannerPluginRepository’: Initialization of bean failed; nested exception is java.lang.IllegalStateException: The plugin [javacustom] does not support Java 11.0.19

Any ideas how else to fix this?

Thx & BR,
Alex

Thanks.

Are you analyzing Java code when you use the sonar-scanner-cli-docker image? Or does it always happen, no matter the language?

No, there is no java code in this project. But I don’t know if this plugin is necessary for custom rules for our project (PHP / TypeScript).

If not, can we disable the plugin when running the scanner?

BR,
Alex

All plugins have to get used in case they declare things like language extensions that will be used to determine if they’re needed or not.

So I guess the author has targeted Java 17 (we don’t even do this with our own analyzers that we develop for our products).

And, it might be a nightmare trying to get everyone to use Java 17 when the requirements (and documentations) for SonarQube are clear that Java 11 and Java 17 are supported.

With that in mind, can you ask the plugin developer to target Java 11?

Our Java projects are developed in 17. I think this is the reason why it’s being targeted.

Thank you for your clarification, I will talk to our “plugin manager” and see if we can come up with a solution :slight_smile:

BR,
Alex

And I’ll… figure out who to nudge about Java 17 support in the docker image (it will have to happen sooner or later)

1 Like