2014-02-18 59 views
0

我使用SonarQube 4.1.1,並在我的pom.xml文件如下配置:聲納4.1.1 Maven插件解決不了

<pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>sonar-maven-plugin</artifactId> 
       <version>4.1.1</version> 
      </plugin> 
     </plugins> 
    </pluginManagement> 

當我嘗試從命令運行聲納使用maven插件我得到:

[ERROR] Plugin org.codehaus.mojo:sonar-maven-plugin:4.1.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:sonar-maven-plugin:jar:4.1.1: Failure to find org.codehaus.mojo:sonar-maven-plugin:pom:4.1.1 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] 

任何人都知道如何解決這個問題?我是否需要進行一些配置更改?

回答

1

實際上這種配置是不需要的。你有沒有嘗試進行分析?如果你沒有,你應該試試。 但是,如果您確實需要強制使用sonar-maven插件的版本,則應在Maven 3上將其設置爲2.1。 有關更多詳細信息,請參見http://docs.codehaus.org/display/SONAR/Analyzing+with+Maven

Regards

0

試試這個:

mvn clean sonar:sonar -U 

-U標誌意味着依賴強制更新。

+0

仍然收到相同的錯誤。 – Zak

+0

那麼,請嘗試刪除本地存儲庫(默認爲$ HOME/.m2/repository)並再次嘗試相同的命令。 – yanana

+0

我已經這樣做了,它仍然無法獲取依賴關係。我甚至將插件罐安裝到我的本地存儲庫中,但仍然出現相同的錯誤。這讓我瘋狂。 – Zak

相關問題