2017-04-04 73 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帮助。