2013-02-28 41 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