build.xml 用于 Netbeans 中的常春藤

build.xml for ivy in Netbeans

我正在尝试将 Apache Ivy 集成到 Netbeans Web 应用程序项目中。

我的 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> 

奇怪的是,这会更新 nbprojects.project.properties 文件中的 ivy.classpath,但我似乎无法让构建的 WEB-INF/lib 文件夹填充 .jar 的被列为依赖项。

奇怪的是,前几天我有这个工作并且能够填充构建的 WEB-INF/lib 文件夹,现在当我删除依赖项时,相同的 jar 文件包含在构建中(而不是删除它们) .

关于如何更改 build.xml 文件有什么建议吗?或者任何其他能让 Ivy 成功集成到我的构建过程中的东西(检测到 Ivy:我在构建时在输出中看到 "resolution report" 和 "retrieving")。

我尝试过的一些事情: 我在上面的链接教程中尝试了不同的选项(尝试包括: <property name="ivy.lib.dir" value="web/WEB-INF/lib/"/>-ivy-retrieve任务中或在<ivy:retrieve/>之前添加<ivy:resolve/>任务)

ivy:retrieve task 有一个 sync 属性 删除不再相关的依赖项。 另外,做一个 clean and build 有帮助。