sonar-maven-plugin 5.1.1 not found - maven

I've just installed the latest version of SonarQube (5.1.1) and when I try to run the sonar:sonar target, I get an error:
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.codehaus.sonar:sonar-maven-plugin:pom:5.1.1
I've checked here:
http://mvnrepository.com/artifact/org.codehaus.sonar/sonar-maven-plugin
And it seems that version 5.1.1 of the sonar-maven-plugin has not been pushed to the public repo(s).
Is that so or am I looking in the wrong location?

The sonar-maven-plugin is an independent project that does not follow SonarQube versioning.
Correct command-line is mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
The groupId mvn.codehaus.sonar is for internal use.

Related

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]
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.

Latest release of sonar maven plugin is broken

It looks like they released latest version of sonar maven plugin which is under org/sonarsource/scanner/maven/sonar-maven-plugin/3.8.0.2131/
However it has a dependency below that is missing in the public maven repos :-
org.sonarsource.scanner.api:sonar-scanner-api:jar:2.16.0.226
The latest version i could find for this dependency is 2.15.0.2182 available in public repos
This is causing most of our build failures now where we use sonar goal in maven. I know we can fix this by specifying the version something like below :-
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
However, that would require us to make changes in a number of places.
Is anyone in the community aware of this and if so do we know if they are going to fix the latest version of sonar maven plugin and make all its dependencies available?
For the moment you can specify in your Jenkins job the version of the plugin :
mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar
SonarSCanner for Maven

Jenkins build failed: Could not find dependency version in maven remote repo

I created a new version in the one project, the version is x.xx.x-SNAPSHOT and used in another project as an external library then pushed it. now Jenkins build is failed.
it's saying that this new dependency is not found in my company repo. I don't have an idea how to fix this.
ERROR: The POM for jar: X.XX.X-SNAPSHOT is missing, no dependency information available
Could not find artifact :jar: X.XX.X-SNAPSHOT in artifactory (maven.xx.xx/repo)
could you please help me?
Thank you
It's fixed now. the problem was, i haven't upload new version in maven remote repo(my company repo). now I did mvn deploy. then it's uploaded and jenkins found the needed dependency.

SonarQube 5.1.2 and maven 3.3 integration

I am trying to integrate SonarQube 5.1.2 with Maven 3.3. But I think it's only supported till SonarQube version 5.1.
When I run mvn sonar:Sonar
Embedded error: Unable to build project for plugin 'org.codehaus.sonar:Sonar-mav
en-plugin': POM 'org.codehaus.sonar:Sonar-maven-plugin' not found in repository:
Unable to download the artifact from any repository
org.codehaus.sonar:Sonar-maven-plugin:Pom:5.1.2
from the specified remote repositories:
central (http://repo1.maven.org/maven2),
Any thoughts?
The correct command-line is mvn org.codehaus.mojo:sonar-maven-plugin:sonar (see the difference of groupId). It is supported by all versions of Maven 3 and SonarQube.
sonar:Sonar != sonar:sonar beware of the spelling.

Integrating sonarqube with Jenkins

I am trying to run sonar sonar:sonar by integrating sonarqube and jenkins. While doing, am getting the below error.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project iwm_common: Can not execute SonarQube analysis: org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext -> [Help 1]
Jenkins version - 1.612
Sonarqube version - 3.6
JDK-1.7.0_76
Maven - 3.1.1
Jenkins WAR is deployed in server A and sonarqube is deployed in server B. I have not installed sonar-jenkins plugin in Jenkins.
Can anyone let me know whether sonar-jenkins plugin is mandatory to be installed in jenkins to integrate jenkins with any sonar server (eg:sonarqube).
If the answer is YES, then after installation of the required plugin, will adding the sonar server (eg:sonarqube) information under Manage Jenkins -> Configure system -> sonar resolve the above error ?
The error is related to sonar-maven-plugin and this plugin is not used in any of the project's pom.xml. Can anyone please explain whether this plugin gets referred as a part of sonar:sonar goal. Thanks.
The versions you specified are not compatible for running sonar analysis.
Please upgrade SonarQube version (current is 5.1.1) which requires
Java 1.7-1.8
SonarQube 5.0 or 5.1.1
Sonar-runner 2.4
Using latest version of sonarqube resolved the issue mentioned.

Resources