首页 > 解决方案 > Ant 在构建期间不读取 IvySettings.xml 文件

问题描述

我想从我的内部存储库下载我的 Ant 项目(在 Netbeans 上运行)中的所有依赖项/jar。

  1. 我已经安装了 ivy jar 并将它放在我的 Apache ant 的 lib 文件夹中。 在此处输入图像描述

  2. 我将 ivysettings.xml 保存在我的根文件夹中(我有我的 build.xml) 在此处输入图像描述

2.i。我的 ivysettings.xml 文件是:

<ivysettings>
    <properties file="${ivy.settings.dir}/ivysettings-file.properties"/>
    <settings defaultResolver="https://my-internal-repo.com/artifactory"/>
    <caches  defaultCacheDir="${cache.dir}" checkUpToDate="false"/>
    <credentials host="https://my-internal-repo.com/artifactory" realm="Artifactory Realm" username="usrname" passwd="ABCD"/>
    <resolvers>
            <url name="https://my-internal-repo.com/artifactory">
            <ivy pattern="https://my-internal-repo.com/artifactory/webapp/#/artifacts/browse/tree/General/Maven-JCentral-cache/org/apache/ivy/ivy/2.2.0/ivy-2.2.0-sources.jar"/>
            <artifact pattern="https://my-internal-repo.com/npm-remote-cache/mongodb/-/mongodb-3.1.13.tgz"/>
            </url>
            <filesystem name="internal">
                    <ivy pattern="${repository.dir}"/>
                    <artifact pattern="${repository.dir}"/>
            </filesystem>
    </resolvers>
    <modules>
            <module organisation="com.myOrg.*" name=".*" resolver="internal"/>
    </modules>

2.ii. 我的 ivysettings-file.properties 是:
ivy.settings.dir=C:\Users\Documents\NetBeansProjects\ANTProject\JavaApplication1,
cache.dir=C:\Users\Downloads\IVYCache,
repository.dir=C:\Users\Downloads \repodir

2.iii. 我的 build.xml 文件是: 在此处输入图像描述

  1. 我在系统的环境变量中添加了 IVY_HOME: 在此处输入图像描述

  2. 现在,当我从我的根文件夹(我有我的 build.xml)从 cmd 输入命令“ant”时,构建成功,但我在构建日志中看不到关于 cmd 上的 Ivy 的字样。我认为它没有阅读我的常春藤设置。我该如何修复它以及如何验证我的 ivysettings.xml 是否已读取,因为我必须限制我的 netbeans 从 my-internal-repository 下载所有依赖项。

请让我知道我还缺少什么?

标签: javanetbeansantivy

解决方案


你的 ivy-2.2.0-sources.jar 可能只包含 ivy 的源而不是你或 ant 需要的编译类,尝试下载 ivy-2.2.0.jar。


推荐阅读