SonarScanner doesn't work with latest Maven 4 Beta Release

Must-share information (formatted with Markdown):

  • SonarScanner 4.0.0.4121
  • SonarCube Cloud
  • SONAR_TOKEN=*** ./mvnw --no-transfer-progress verify sonar:sonar

Sonar Scanner works fine with Apache Maven 4.0.0-beta-4 but fails with Apache Maven 4.0.0-beta-5

SONAR_TOKEN=*** ./mvnw --no-transfer-progress verify sonar:sonar
org.codehaus.plexus.classworlds.launcher.ConfigurationException: No such property: maven.mainClass
	at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.filter(ConfigurationParser.java:355)
	at org.codehaus.plexus.classworlds.launcher.ConfigurationParser.parse(ConfigurationParser.java:114)
	at org.codehaus.plexus.classworlds.launcher.Configurator.configure(Configurator.java:123)
	at org.codehaus.plexus.classworlds.launcher.Launcher.configure(Launcher.java:116)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:356)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:314)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:52)
	at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:161)
	at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:73)
Error: Process completed with exit code 100.

Full build log: chore(deps): update dependency maven to v4.0.0-beta-5 · helpermethod/zip-forge@b731ed4 · GitHub

Hi Oliver,

Welcome to the community!

Thank you for reporting the issue and providing the GitHub job link—it really helps.

Using the information from the job, I couldn’t reproduce the issue locally. Maven 4.0.0-beta-5 isn’t stable yet, so the problem might be resolved in the final release. In the meantime, we’ll keep an eye out for similar reports.

Best,
Erwan

1 Like