0

Am new to SONAR.. and my task is to analyze a Maven project.

I followed all the steps as mentioned on the SONARQube website http://docs.codehaus.org/display/SONAR/Analyzing+with+Maven

everything! But when I try to run their sample example. Am getting this error..

[INFO] Building Simple Java Maven Project
[INFO]    task-segment: [sonar:sonar] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [sonar:sonar {execution: default-cli}]
[INFO] Sonar host: http://localhost:9000
[INFO] Sonar version: 4.1
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:4.1:sonar
Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/codehaus/sonar/so
nar-maven-plugin/4.1/sonar-maven-plugin-4.1.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:4.1' i
n repository central (http://repo1.maven.org/maven2)
Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/codehaus/sonar/so
nar-maven-plugin/4.1/sonar-maven-plugin-4.1.pom
[INFO] Unable to find resource 'org.codehaus.sonar:sonar-maven-plugin:pom:4.1' i
n repository central (http://repo1.maven.org/maven2/)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute 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:4.1

from the specified remote repositories:
  ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2)

 for project org.codehaus.sonar:sonar-maven-plugin

Am not sure what is wrong.. have searched.. still no result.

swateek
  • 6,735
  • 8
  • 34
  • 48

1 Answers1

0

Looks like iBiblio Maven repository is not fully synchronized with Maven Central - on which you can find the 4.1 version without any issue.

You should update your Maven configuration to not use this repository - but to use the standard one.

  • I checked my Maven configuration and its totally clean.. I mean downloading from central repository. Is there any SONAR side configuration to this effect? – swateek Jan 28 '14 at 05:35
  • Well I tried that sonar-runner command instead of mvn sonar:sonar and everything went fine. Can you please elaborate on the difference between the 2? Am getting confused. Mine is a multi-module maven project that uses Java as language. – swateek Jan 28 '14 at 13:46
  • 1
    Sonar Runner does not depend on a Maven repository, so this is normal that it works. Maven needs a SonarQube Maven plugin that is released with each new version of SonarQube, and your configuration points to a deprecated repository so you can't get it. – Fabrice - SonarSource Team Jan 29 '14 at 10:23