** 1: Install Ivy for Eclipse. The URL for the update site is: http://www.apache.org/dist/ant/ivyde/updatesite/ . Make sure you only select the most recent versions of Ivy and IvyDE when installing.
** 2: Add a file called ivy.xml to the root of your project. This file contains information about your Ivy module and declares dependencies. Paste in the following code (I included a dependency on Gson so we can quickly ensure Ivy is working):
<ivy-module version="2.0">
<info organisation="com.corporation.my" module="my-module" revision="1.0" />
<dependencies>
<dependency org="com.google.code.gson" name="gson" rev="2.3.1" />
</dependencies>
</ivy-module>
** 3: Right click the WO project you want to add dependency management to. Select “Properties -> Java Build Path -> Add Library -> IvyDE Managed Dependencies” and click “Finish”. Ivy is now in your Eclipse project and dependencies declared in ivy.xml will appear in the “Ivy" classpath container of your project. In oter words; you can start using Gson while developing within Eclipse. But we still have a couple of things to do to make Ivy work in your ant-builds.
** 4: Modify your build.xml to use Ivy for resolving dependencies:
a) Define the Ivy namespace declaration in the <project> tag:
<project name="Strimillinn" default="build" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
b) Add a target for resolving dependencies using Ivy:
<target name="resolve" description="retrieve dependencies with ivy">
<ivy:retrieve pattern="Libraries/[artifact]-[revision]-[type].[ext]" />
</target>
c) Finally, make the "init.build" target depend on the "resolve" target.
<target name="init.build" depends="init.properties,resolve">
** 5: Install the ivy ant-task on your build machine (if you have one). One way to do that is to download the .jar from Ivy’s site and put it in ~/.ant/lib
Cheers,
- hugi
// Hugi Thordarson
// http://www.loftfar.is/
// s. 895-6688
On 1. maí 2015, at 23:28, Paul Hoadley <email@hidden> wrote:
On 2 May 2015, at 7:52 am, Hugi Thordarson <email@hidden> wrote:
Most of our in-house code is written as pure java/scala projects which are then built, versioned and deployed to a local Maven server using Maven and SBT.
We use WO a lot but maintaining the WO applications “old style” (by copying dependencies into “Libraries” every time something changes) is becoming quite tiresome. So I’m wondering if anyone would care to share success stories or tips on methodology for dependency management with WO? Some years ago I heard of people using Ivy for dependency management in the WO ant scripts, but haven’t heard much about it since.
We did try using Maven for all WO development, but I found that WOLips didn’t really like it. Perhaps that’s working better now?
We don’t use Maven, but I’m interested in the topic. Henrique Prange would be the local expert on this.
--
Paul Hoadley
http://logicsquad.net/