Tuesday, November 15, 2011

Eclipse - Ant & Ivy

Eclipse is Ant ready out of the box.

To make it Ivy ready, go to Window->Preferences->Ant->Runtime->Classpath->Global Entries

Click on 'Add External Jars' and add the Ivy jar that we downloaded earlier.
Now it is Ivy ready.

Copy the build.xml, ivy.xml, ivysettings.xml and ivysettings-public.xml to the HelloWorld project folder (in the root directory, same place as .classpath)

Go to Window->Show View->Ant - this will open the Ant viewer

Drag drop the build.xml to this viewer - you will now be able to see all the Ant targets in the build.xml

Double-click on the 'dist' target to build the HelloWorld.jar

In the Navigator view, select the HelloWorld project and hit F5 to refresh.

You will now see the /target and /classes directories that were added by the Ant build.

If you delete the /lib directory, then rerun Ant 'dist' and refresh - you will see the /lib reappear with the log4j.jar - proof that Ivy is working.

No comments: