2
votes

With SonarQube 6.5, jdk 1.8.0_144 and sonar.maven.plugin 3.3.0.603, running mvn sonar:sonar gives me the following error:

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project tdd: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar: javax/xml/bind/JAXBException

What am i missing?

Thanks,

Nilesh

2

2 Answers

1
votes

I encountered this issue today as well. I recently installed JDK 9.0.1 and had switched the language level of my project over to source and target version 1.9. Executing a clean install triggered this exception. The issue was fixed and released recently in issue 2506 of their JIRA, so updating the sonarjava plugin from the sonarqube instance's administation panel fixed the issue for me.

0
votes

Run into the same exact problem while running sonar analysis with java-9.

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: D:\java\maven\3.5.0\bin\..
Java version: 9, vendor: Oracle Corporation
Java home: D:\java\jdk\1.9.0_181
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
...
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ _test ---
...
[INFO] SonarQube version: 6.5.0
...
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project
maven:sonar-maven-plugin:3.3.0.603:sonar: javax/xml/bind/JAXBException

Same build still works fine with java-8.

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00)
Maven home: D:\java\maven\3.5.0\bin\..
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: D:\java\jdk\1.8.0_131\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
...
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ _test ---
...
[INFO] SonarQube version: 6.5.0
...
[INFO] BUILD SUCCESS

I see same behavior with javax.javaee-api 6.0 7.0 or 8.0 thus problem seems to be not related to project dependencies.

Older org.sonarsource.scanner.maven.sonar-maven-plugin 3.2 version of plugin produces same result thus problem is not related to newer 3.3.0.603 plugin version.

Run only with maven 3.5.0.

Just for sake of it successfully tested with 1.8.0_144 in addition to 1.8.0_131.

Exact version of SonarQube is 6.5.0.27846.

Just a suggestion: make sure you are actually running java-8.

mvn -v