2011-07-08 67 views
2

我想用Maven配置Spring 3.0。我讀過http://blog.springsource.com/2009/12/02/obtaining-spring-3-artifacts-with-maven/Spring 3.0和Maven

在我的pom.xml中,我定義了以下庫:

<repositories> 
    <repository> 
     <id>com.springsource.repository.bundles.release</id> 
     <name>EBR Spring Release Repository</name> 
     <url>http://repository.springsource.com/maven/bundles/release</url> 
    </repository> 
    <repository> 
     <id>com.springsource.repository.bundles.external</id> 
     <name>EBR External Release Repository</name> 
     <url>http://repository.springsource.com/maven/bundles/external</url> 
    </repository> 
</repositories> 

然後我試着用最基本的依賴性:

<dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>org.springframework.core</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 

其中

<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <org.springframework.version>3.0.5-RELEASE</org.springframework.version> 
</properties> 

但是,如果他彈簧芯沒有找到。

[警告]爲org.springframework的POM:org.springframework.core:罐子:3.0.5-RELEASE丟失,可用的依賴信息

[錯誤]未能執行項目彈簧食譜目標:無法解析項目org.obliquid的依賴關係:spring-recipes:war:0.0.1-SNAPSHOT:無法找到工件org.springframework:org.springframework.core:jar:3.0.5-RELEASE in com.springsource.repository .bundles.release(http://repository.springsource.com/maven/bundles/release) - > [Help 1]

我能做些什麼來解決這個問題?

+0

我不知道,如果你需要的EBR拷貝,但我有一個與「從Maven的中央」的人正常工作項目在該頁面上詳細說明。 – Darien

+0

是的,我在Maven Central方面取得了有限的成功,然而並非所有的Javadocs源都可用。有時我遇到組件問題,但可能是因爲我不知道正確的名稱。我想直接看看泉源的情況是否更好。 – stivlo

回答

2

應該

<org.springframework.version>3.0.5.RELEASE</org.springframework.version> 

,而不是

<org.springframework.version>3.0.5-RELEASE</org.springframework.version> 
+0

謝謝你肯......我犯了多麼愚蠢的錯誤! :-) – stivlo

+0

stivlo,不客氣,:-) –

+0

當他們命名與傳統Maven工件命名不同的工件時,他們違背穀物並不是你的錯。我認爲你所嘗試的應該是這個名字。 –