2014-01-29 64 views
1

我想建立具有以下依賴Maven的抱怨依賴於WAR文件

<dependency> 
    <groupId>org.richfaces.examples</groupId> 
    <artifactId>richfaces-showcase</artifactId> 
    <version>4.3.4.Final</version> 
    <classifier>jbas71</classifier> 
    <type>war</type> 
</dependency> 

雖然WAR文件似乎是在我的本地回購正確的地方項目。 .m2/repository/org/richfaces/examples/richfaces-showcase/4.3.4.Final/

  • RichFaces的 - 展示 - 4.3.4.Final-jbas71.war
  • RichFaces的 - 展示 - 4.3.4.Final-jbas71.war.lastUpdated
  • RichFaces的 - 展示 - 4.3.4內容.Final-jbas71.war.pom

我試圖刪除文件​​,*.war.pom似乎是確定太多,但我仍然得到

[ERROR] Failed to execute goal on project richfaces-showcase-portlet: 
Could not resolve dependencies for project org.jboss.portletbridge.examples:richfaces-showcase-portlet:war:3.3.1.Final: 
Failure to find org.richfaces.examples:richfaces-showcase:war:jbas71:4.3.4.Final 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] 
+0

當您從本地存儲庫(.m2)中刪除戰爭並運行mvn install時會發生什麼? – Kick

+1

我相信你嘗試過使用'-U'強制更新選項? –

+0

@ AndersR.Bystrup:當然,我忘了提及它 –

回答

2

依賴意味着錯誤,導致戰爭文件不打算成爲依賴。戰爭文件的目的是作爲一個例子,可以部署到Tomcat等,看看它是什麼樣子。

除此之外,你正試圖從Maven中心獲得richfaces這是不可能的原因Richfaces不在Maven中心。他們有自己的存儲庫。您需要將此存儲庫添加到您的配置或存儲庫管理器。

而且消息:

Failure to find org.richfaces.examples:richfaces-showcase:war:jbas71:4.3.4.Final 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] 

表明,依賴無法下載。我假設戰爭文件的大小爲0 ..

+0

大小WAR很少MB,所以看起來不錯。是的,WAR不在Maven中心,但是我在本地擁有它,應該沒問題,不是嗎?我在一個子項目中使用它來與Maven WAR插件重疊,這就是爲什麼我需要依賴它。 –

+0

你是什麼意思?該消息表示您正在訪問Maven中心。好。對於疊加,這是你沒有提到的另一個故事。 – khmarbaise

+0

是的,但重點是我在本地repo中安裝了這個工件,但Maven顯然無法找到它,所以它嘗試Maven中心,當然會失敗。所以問題是爲什麼?正確的WAR位於我本地回購的正確文件夾中,那麼爲什麼Maven在構建期間無法找到它? –