Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this
Hi,
Background:
I have a project with Java 11, and SonarQube version 6.5 installed.
Issue/Error:
When I call for SonarQube for scanning using “mvn sonar:sonar”, it gives javax/xml/bind/JAXBException, portion of the error below.
Things I have tried but did not work
-
I googled that Java 11 package for javax.xml.bind does not exist anymore, so in order to fix this issue, need to manually add the JAXB Maven dependencies (Jaxb-core, Jaxb-api, Jaxb-impl) to project’s pom.xml which i have added
-
Another suggestion is to add “sonar-maven-plugin” which i have added
-
One also suggested to check the availability of “sonar-java-plugin” in the SonarQube installation’s plugin folder, which i have checked and is available
Let’s assume that upgrading the version of SonarQube is not readily available unless backed by strong evidence that the current setup definitely will not work.
Any help is welcome.
Thanks.
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project myapp: 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
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = path-to-m2/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.3.0.603/sonar-maven-plugin-3.3.0.603.jar
[ERROR] urls[1] = path-to-m2/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
[ERROR] urls[2] = path-to-m2/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[3] = path-to-m2/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[4] = path-to-m2/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[5] = path-to-m2/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[6] = path-to-m2/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[7] = path-to-m2/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.9.0.887/sonar-scanner-api-2.9.0.887.jar
[ERROR] urls[8] = path-to-m2/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[9] = path-to-m2/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : javax.xml.bind.JAXBException
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException