0

I am getting the below exception upon ivy-configure tag , i have configured the ivy configure tag in my build-ivy.xml as shown below

my ivy.xml is at the below path..

/ops/ivy/ivy.xml

my ivy-settings.xml is at..

/ops/ivy/ivysettings.xml

and my ivy:configure entry in build.xml as shown below ...

<!-- Ivy -->
    <target name="prepare" description="Ivy setting load">
            <echo message="Saral in Prepare"/>
            <delete dir="${project_dependencies}"/>
            <mkdir dir="${project_dependencies}"/>
            <path id="classpath">
                <fileset dir="lib">
                    <include name="${ops.dir}/ivy/ivy-2.3.0.jar"/>
                </fileset>
            </path>


            <ivy:configure file="${ops.dir}/ivy/ivysettings.xml" />
                    <ivy:retrieve  type="jar" pattern="${project_dependencies}/[artifact].[ext]"/>
            </target>

the error that i am getting is ...please advise where i need to configure ivy.xml

prepare:
     [echo] Saral in Prepare
   [delete] Deleting directory C:\DTSTOTALUPLOADED\Glacier\project_dependencies
    [mkdir] Created dir: C:\DTSTOTALUPLOADED\Glacier\project_dependencies
[ivy:configure] :: Apache Ivy 2.3.0 - 20130110142753 :: http://ant.apache.org/ivy/ ::
[ivy:configure] :: loading settings :: file = C:\DTSTOTALUPLOADED\Glacier\ops\ivy\ivysettings.xml
[ivy:retrieve] C:\DTSTOTALUPLOADED\Glacier\ivy\ivy.xml (The system cannot find the path specified) in file:/C:/DTSTOTALUPLOADED/Glacier/ivy/ivy.xml

BUILD FAILED

folks please advise on this..!

1 Answers1

0

Ivy is designed to manage a software projects dependencies, using an ivy file that is normally committed locally into the source code.

For a working example see:

Additional info

Location of ivy file

Typically the project files look something like the following:

├── build.xml
├── ivy.xml        <-- Ivy file detailing project dependencies
└── src
    └── main
        └── java
            └── myorg
                └── MyClass.java

Cleanup targets

I would suggest moving build cleanup logic into a separate set of targets and additionally leverage the cleancache ivy task.

<target name="clean" description="Cleans up files created by build">
  <delete dir="build"/>
  <delete dir="lib"/>
</target>

<target name="clean-all" depends="clean" description="Additionally purge ivy cache">
  <ivy:cleancache/>
</target>

Managing classpath

A more efficient way to manage the build classpath is to use the ivy cachepath task instead of retrieve.

This approach is especially powerful if you use ivy configurations, allowing you to control multiple classpaths.

Bootstrapping ivy

I don't think the following code is redundant:

<path id="classpath">
  <fileset dir="lib">
    <include name="${ops.dir}/ivy/ivy-2.3.0.jar"/>
  </fileset>
</path>

Adding the ivy jar onto a project path after ANT is started would be too late. Check your $ANT_HOME/lib or ~/.ant/lib directories. I'll bet the ivy jar is there already?

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185