Search code examples
sonarqubegson

Trying to analyze Gson project with sonarQube "Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:6.2.0:bnd-process (default) on project gson"


I have downloaded a .zip of the official Gson project repo from github. I have docker installed And I'm trying to analyze Gson with SonarQube.

I have chose the local project option and created a new token and chose maven to analyze:

when I run this command:

mvn clean verify sonar:sonar -Dsonar.projectKey=GSON-res -Dsonar.host.url=http://localhost:9000 -Dsonar.login=token_code                                                       

I get this error:

[ERROR] Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:6.2.0:bnd-process (default) on project gson: Classes found in the wrong directory: {com/google/gson/package-info.class=com\google\gson\package-info, com/google/gson/internal/package-info.class=com\google\gson\internal\package-info, com/google/gson/reflect/package-info.class=com\google\gson\reflect\package-info, com/google/gson/stream/package-info.class=com\google\gson\stream\package-info, com/google/gson/annotations/package-info.class=com\google\gson\annotations\package-info} -> [Help 1]          

Solution

  • This appears to be unrelated to SonarQube and is caused by a bug in the Maven Compiler Plugin version used by Gson: MCOMPILER-485

    The Maven Compiler Plugin dependency of Gson has been updated to the fixed version 3.10.1, so this issue should be solved once you pull the latest Gson source code again.