2013-02-28 127 views
0

我的构建运行正常,直到我下面的行添加到我的ivy.xml文件:常春藤未解析的依赖性使用Spring数据JPA当 - org.eclipse.persistence

<dependency org="org.springframework.data" name="spring-data-jpa" rev="1.1.0.RELEASE"/> 

然后我得到以下错误:

:::::::::::::::::::::::::::::::::::::::::::::: 
::   UNRESOLVED DEPENDENCIES   :: 
:::::::::::::::::::::::::::::::::::::::::::::: 
:: org.eclipse.persistence#org.eclipse.persistence.jpa;2.3.2: not found 
:::::::::::::::::::::::::::::::::::::::::::::: 

我似乎无法在Maven回购库中找到此依赖关系。当不使用常春藤,我能成功编译我的项目,这个jar:

com.springsource.javax.persistence-2.0.0.jar 

不过,我也不能找到一个在Maven回购的参考。

我在想什么或做错了什么?新使用常春藤,所以任何和所有的帮助表示赞赏。

回答

2

默认情况下,常青藤会拉下所有的依赖关系。这很可能是一个可选的Maven依赖关系,它不存在于Maven Central中。

你需要做的是设置为每个依赖的常春藤配置映射如下:

<configurations> 
    <conf name="compile" description="Compile classpath"/> 
    <conf name="runtime" description="Runtime classpath" extends="compile"/> 
    <conf name="test" description="Test classpath" extends="runtime"/> 
</configurations> 

<dependencies> 
    <!-- compile dependencies --> 
    <dependency org="org.springframework.data" name="spring-data-jpa" rev="1.1.0.RELEASE" conf="compile->default"/> 
</dependencies> 

映射“编译期>默认”是指下拉默认的依赖(这将排除选配)从远程模块并将它们放到本地编译配置中。

有关常春藤如何转化远程Maven模块的详细信息请参阅:

+0

这帮助了很多。谢谢! – SBerg413 2013-03-01 15:38:14