Search code examples
javanetbeansantivy

IvySettings.xml file is not read by Ant during build


I want to download all dependencies/jars in my Ant project (Running on Netbeans) from my internal repository.

  1. I have installed ivy jar and placed it in my Apache ant's lib folder. enter image description here

  2. I have kept ivysettings.xml in my root folder (where I have my build.xml) enter image description here

2.i. My ivysettings.xml file is:

<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. My ivysettings-file.properties is:
ivy.settings.dir=C:\Users\Documents\NetBeansProjects\ANTProject\JavaApplication1,
cache.dir=C:\Users\Downloads\IVYCache,
repository.dir=C:\Users\Downloads\repodir

2.iii. My build.xml file is: enter image description here

  1. I have added IVY_HOME in my system's env variable: enter image description here

  2. Now when I am entering command "ant" from my root folder (where I have my build.xml) from cmd the build is successful but I cant see a word about Ivy on cmd in build logs. I think its not reading my ivy settings. how can I fix it and how will I verify that my ivysettings.xml is read bcoz I have to restrict my netbeans to download all dependencies from my-internal-repository.

Please do let me know what else I am missing ?


Solution

  • your ivy-2.2.0-sources.jar might only contain the sources of ivy not the compiled classes you or ant would need, try to download ivy-2.2.0.jar.