Malepati Phani Kumar

My Personnel Blog

Configuring Apache Ivy In Windows

on October 21, 2009

What is Apache Ivy:

Ivy is a java dependency  management tool developed by Apache. The main purpose of Ivy is for recording, tracking, resolving and reporting project dependencies.

Wikepedia Def:

Apache Ivy is a transitive dependency manager currently under development as a sub-project of the Apache Ant project. Ivy works with Apache Ant to resolve Java (or other language) project dependencies. An external XML file defines project dependencies and lists the resources necessary to build a project. Ivy then resolves and downloads resources from an artifact repository: either a private enterprise repository or a publicly available one on the Internet

Let me break the above sentence:

Ivy downloads dependencies from central dependency management with in the company (a.k.a private enterprise repository) , if that particluar dependency is not available with in the private network , Ivy resolves by searching the Apache dependency networks like Ibiblio.org and retrive it from there and downloads to your projects library folder(which you define in build.xml, ivy.xml)

How to get Ivy:

If you are using Ant 1.6.0 or higher version then you need not to install Ivy saperately, Ivy by itself come with Ant 1.6.0. and higher version.

Not sure which version of Ant you have? Just type ant -version in command prompt.

ant -version

Since Ivy is from Apache ,its opensource and totally free to use for all commercial and non-commercial projects.

  • Go to http://ant.apache.org/ivy/index.html or google "Apache Ivy"
  • Click on "Download" and choose binary version
  • Ivy
  • Version may changes , but I suggest you to choose binary version.
  • Download the zip file and extract to your favourite location.
  • Rename ivy-[version number].jar to ivy.jar
  • ivy jar
  • Copy ivy.jar  to ANT_HOME/lib folder (You can find this location by doing "cd %ANT_HOME%" in command prompt).

Sample Project:

Let's quick start Ivy with a sample project, If you downloaded the .zip folder listed above, your project is ready .

Go to src/example folder of apache-ivy-2.1.0

ivy example

Open "hello-ivy" folder thru command prompt and type "ant" hit enter.

ant cmd

As you see in the above image, dependencies are downloading from public repositories (repo1.maven.org). This is the real power of Ivy.

The secret behind Ivy is in Ivy.xml, open ivy.xml from hello-ivy folder it looks the following way:

ivy

Please read ivy documentation from the following website: http://ant.apache.org/ivy/history/latest-milestone/tutorial.html

I tried to pull most of the information from various way, and little my own experience, Please drop the feedback or queries and let me know if you have any queries.

–Kumar


One Response to “Configuring Apache Ivy In Windows”

  1. Gultekin Butun says:

    Hi,
    My name is Gultekin and I am from Turkey.  Thanks your informations. But I have a trouble about the Apache Ivy. All configurations of Apache Ant and Ivy was completed. To use the Ivy, Do I have to connect to the internet every time. So Does It require the internet connection? Thanks for read.
    Regards,
    Gultekin

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>