2011-10-18 49 views
1

我正在嘗試使用Ivy下載Spring Batch和Spring Framework,而且我並沒有走得太遠。在Ivy中未解決Spring Framework依賴關係

依賴於的ivy.xml:

<dependency org="org.springframework.batch" name="org.springframework.batch.core" rev="2.1.6.RELEASE" /> 
<dependency org="org.springframework" name="org.springframework.spring-library" rev="3.0.6.RELEASE" /> 

ivysettings.xml:

<ivysettings> 
<settings defaultResolver="chained"/> 
<resolvers> 
    <chain name="chained"> 
     <url name="com.springsource.repository.bundles.release"> 
      <ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
      <artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
     </url> 
     <url name="com.springsource.repository.bundles.external"> 
      <ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
      <artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> 
     </url> 
    </chain> 
</resolvers> 
</ivysettings> 

的build.xml:

... 
<ivy:settings file="ivysettings.xml"/> 
... 
<target name="resolve" description="retrieve dependencies with ivy"> 
    <ivy:retrieve/> 
</target>  

當我運行ant resolve我得到如下:

[ivy:retrieve]  :::::::::::::::::::::::::::::::::::::::::::::: 
[ivy:retrieve]  ::   UNRESOLVED DEPENDENCIES   :: 
[ivy:retrieve]  :::::::::::::::::::::::::::::::::::::::::::::: 
[ivy:retrieve]  :: org.springframework#org.springframework.spring-library;3.0.6.RELEASE: not found 
[ivy:retrieve]  :::::::::::::::::::::::::::::::::::::::::::::: 

我在做什麼錯? I've used this page獲取配置。

回答

1

Spring庫現在通過Maven Central發佈。這意味着他們可以使用Maven的搜索網站上找到:

這意味着你需要如下聲明你的依賴:

<dependency org="org.springframework.batch" name="spring-batch-core" rev="2.1.8.RELEASE"/> 
<dependency org="org.springframework" name="spring-core" rev="3.0.6.RELEASE"/> 

設置文件現在變得可選(Maven Central是默認的ivy)。

如果你想創建一個,使用以下命令:

<ivysettings> 
    <settings defaultResolver="central"/> 
    <resolvers> 
     <ibiblio name="central" m2compatible="true"/> 
    </resolvers> 
</ivysettings>