2017-04-04 69 views
0

我正在嘗試將Apache Ivy整合到Netbeans web應用程序項目中。netbeans中ivy的build.xml

build.xml文件遵循的NetBeans教程: http://wiki.netbeans.org/FaqIvy

具體做法是:

 <target name="-ivy-retrieve"> 
     <ivy:retrieve/> <!-- Load dependencies to the project --> 
     <pathconvert property="ivy.classpath.computed" dirsep="/" pathsep=":"> 
      <path> 
       <fileset dir="lib" includes="*.jar"/> 
      </path> 
      <map from="${basedir}${file.separator}" to=""/> 
     </pathconvert> 
     <propertyfile file="nbproject/project.properties"> 
      <entry operation="=" key="ivy.classpath" value="${ivy.classpath.computed}"/> 
     </propertyfile> 
    </target> 
    <target name="-pre-compile" depends="-ivy-retrieve"/> 
    <target name="-pre-compile-single" depends="-ivy-retrieve"/> 
    <target name="-post-clean"> 
     <delete dir="lib"/> 
    </target> 

奇怪的是,這將更新ivy.classpathnbprojects.project.properties文件,但我似乎無法得到構建的WEB-INF/lib文件夾來獲得填充作爲依賴關係列出的.jar

奇怪的是,我有這個工作在前一天,並能夠填充構建的WEB-INF/lib文件夾,現在當我刪除依賴,相同的jar文件包含在構建(而不是刪除它們)。

關於如何更改build.xml文件的任何建議?或其他任何能夠將艾維成功整合到我的構建過程中的東西(檢測到常春藤:在構建過程中,我會在輸出中看到「解決方案報告」和「檢索」)。

有些事情我已經試過:

+0

要考慮的另一個優化是使用** cachpath **任務,而不是**檢索**:http://ant.apache.org/ivy/history/latest-milestone/use/cachepath.html –

回答

0

ivy:retrievetask有: 我在上面鏈接的教程不同的選項( <property name="ivy.lib.dir" value="web/WEB-INF/lib/"/>-ivy-retrieve任務或添加<ivy:retrieve/><ivy:resolve/>任務試過含)發揮各地sync屬性,它刪除不再相關的依賴關係。 此外,做一個clean and build幫助。