2011-10-18 50 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>