2012-10-18 57 views
1

我目前正在用常青藤更改我的eclipse構建路徑。在Eclipse中映射多個常青藤文件

在我的portlet構建文件,我特別呼籲所有阻止我指定相同的portlet的公共依賴:

我也有裝的是找回我的依賴性2個常青藤文件成功修改我的ANT構建在每一個Portlet項目librairies:

<if> 
     <available file="${rpm.homedir}/Builder/ivy_portlet.xml" /> 
     <then> 
      <echo message="Getting runtime portlet dependencies using Ivy project's configuration" /> 
      <ivy:resolve file="${rpm.homedir}/Builder/ivy_portlet.xml"/> 
      <ivy:retrieve pattern="${project.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" file="${rpm.homedir}/Builder/ivy_portlet.xml"/> 
     </then> 
     <else> 
      <fail message=" file ${rpm.homedir}/Builder/ivy_portlet.xml not found in the builded project." /> 
     </else> 
    </if> 

下面是build.xml文件的代碼段我所有的項目:

<target name="get-dependencies"> 
    <if> 
     <available file="${basedir}/ivy.xml" /> 
     <then> 
      <echo message="Getting deps using Ivy project's configuration" /> 
      <ivy:resolve file="${basedir}/ivy.xml"/> 
      <ivy:retrieve pattern="${project.lib.dir}/[conf]/[artifact]-[revision](-[classifier]).[ext]" file="${basedir}/ivy.xml"/> 
     </then> 
     <else> 
      <fail message=" file ${basedir}/ivy.xml not found in the builded project." /> 
     </else> 
    </if> 
</target> 

一切運行正常與螞蟻。

如何使用IvyIDE插件設置位於另一個項目中的通用Ivy文件?

+1

在每個項目的根目錄下放置一個ivy.xml文件就簡單多了。 –

回答

2

使用ivy延伸http://ant.apache.org/ivy/history/latest-milestone/ivyfile/extends.html

馬克說,不創建一個問題,然後嘗試去解決它。你可以使用extend來使用其他ivy-portlet.xml [它自己駐留在模塊中],帶extendType =「depenencies」

每個項目使用一個,IvyDE和ivy文檔將在你身邊。嘗試操縱,你會發現自己孤單。

+0

不錯!能夠引用文件以這種方式檢索公共庫: