Sonar quality gate error on upgrading to Java 17 and adding following sure-fire configuration.
mvn sonar:sonar fails in Jenkins build.
[sonar-maven-plugin:3.9.1.2184:sonar (default-cli)
[INFO] SonarQube version: 9.9.1.69595
how is SonarQube deployed:Docker
Sonar quality gate fails after upgrade to Java 17 and adding configuration to maven sure-fire plugin (--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED)
Logs after sonar scan is successfully completed but task fails and quality report is not uploaded.
[2023-12-23T08:15:30.144Z] SonarQube task ‘AYyVvllAgy9onO3KUx8U’ status is ‘IN_PROGRESS’
[2023-12-23T08:15:33.768Z] SonarQube task ‘AYyVvllAgy9onO3KUx8U’ status is ‘SUCCESS’
[2023-12-23T08:15:33.768Z] SonarQube task ‘AYyVvllAgy9onO3KUx8U’ completed. Quality gate is ‘ERROR’
[2023-12-23T08:15:33.784Z] WARNING: sonar-scanner step failed due to quality gate status=ERROR.
[2023-12-23T08:15:33.784Z] Please visit sonarqube for more information (sonarqube link should be in js-static-analysis previous step).
[2023-12-23T08:15:33.784Z]
[2023-12-23T08:15:33.784Z] HINT: Most common failing reason is that you might need to write more tests or there is a sonarqube
[2023-12-23T08:15:33.784Z] configuration error.
Removing above configuration allows sonar quality gate to pas but the unit tests fails as Illegal reflective access is required for unit test to pass with upgrade to Java 17.
Also tried adding :: --illegal-access=permit to configration but this option is ignored with Java17.
13:44:36 [ERROR] OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=permit; support was removed in 17.0
13:44:36 [ERROR] OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended