3
votes

I have an public project on github. i try to attach sonarcloud to it:

./mvnw -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=xxxx-github -Dsonar.login=yyyy

project is built, tests passes and then sonar-maven-plugin:3.0.1:sonar executes:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project xxx: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar: org/sonar/batch/bootstrapper/IssueListener

and at the end of the stacktrace:

Caused by: java.lang.ClassNotFoundException: org.sonar.batch.bootstrapper.IssueListener

what's missing? how to fix that?

  • mvn wrapper with mvn version: apache-maven-3.5.2
  • java 8
  • ubuntu 14.04
2
What is the version of SonarQube? - Jeroen Heier
You should get in touch with the SonarCloud team to help you : about.sonarcloud.io/contact - Julien L. - SonarSource Team
@JeroenHeier it's sonar cloud - piotrek

2 Answers

3
votes

completing @JulienL.-SonarSourceTeam advice:

changing sonar:sonar to org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar solved the problem

so now it is:

./mvnw -X clean org.jacoco:jacoco-maven-plugin:prepare-agent package org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=xxxx-github -Dsonar.login=yyyy
2
votes

Try to use a more recent version of the scanner for Maven. Last released version is 3.3.0.603.