2012-12-01 62 views
3

我是新來的maven。我收到以下錯誤,我不明白。你能幫我理解如何解決它嗎?maven依賴不下載

無法解決以下工件:org.springframework:org.springframework.core:jar:3.0.5.RELEASE,org.springframework:org.springframework.asm:jar:3.0.5.RELEASE:未能找到org.springframework:org.springframework.core:jar:3.0.5.RELEASE在http://repo.maven.apache.org/maven2被高速緩存在本地倉庫中,解析度將不會被重試,直到中央的更新間隔已經過去或更新被強制 - > [幫助1]

回答

0

如果您提供與您的問題POM文件,但是從堆棧跟蹤判斷似乎依賴不正確聲明這將是更有幫助。具體而言,春季正確的工件名稱爲「彈簧芯」,而不是「org.springframework.core」,那麼在你的pom.xml文件,你應該有:

<dependency> 
    <groupId>org.springframework</groupId> 
    <artifactId>spring-core</artifactId> 
    <version>3.0.5.RELEASE</version> 
</dependency> 

您可以在公共找到一個正確的定義依賴Maven Repo搜索引擎(如http://mvnrepository.comhttp://search.maven.org)。這裏是鏈接到彈簧芯神器:http://mvnrepository.com/artifact/org.springframework/spring-core/3.0.5.RELEASE

順便說一句,你看到的錯誤是以下格式:

<groupId>:<artifactId>:<packaging>:<version> 
+0

是的,你是對的,非常感謝你。但是我使用的神器ID在另一臺有聯繫的計算機上工作。這怎麼可能?聯結是否改變工件ID? – shkra19

+0

最有可能是你從這裏使用的是以前的設置來代理Spring的Maven倉庫Nexus的: http://ebr.springsource.com/repository/app/bundle/version/detail?name=org.springframework.core&version=3.0 .RELEASE 也有可能有人用此artifactId手動將工件上傳到Nexus。 – Constantine

1

嘗試使用-U選項運行你的命令。這裏是更多information

+0

如果我這樣做,我得到我在首位的錯誤:下面的文物無法解析:org.springframework:org.springframework.core:罐子:3.0.5.RELEASE,org.springframework:組織。 springframework.asm:jar:3.0.5.RELEASE:無法找到工件org.springframework:org.springframework.core:jar:3.0.5.RELEASE in central(http://repo.maven.apache.org/maven2) - > [求助1] – shkra19

+0

嗯,結帳這個帖子:http://stackoverflow.com/questions/4856307/when-maven-says-resolution-will-not-be-reattempted-until-the-update-interval-of –

+0

換句話說,我的主要問題不是更新間隔沒有過去,而是找不到這個工件。然而這是我的項目所必需的。 repo.maven.apache.org上不存在spring 3嗎? – shkra19

0

呀看起來像你的POM扶養不正確標記。谷歌搜索示例Spring MVC應用程序和lookin示例pom將有所幫助。