Integrate Ivy in a dotNet build

Luca | April 17, 2008

I’m currently involved in a dotNet shop and I’m working on redesigning the build pipeline (good old CI stuff).
Ivy appeared in our brainstorming sessions as solution for the requirement of having a more defined control on the projects dependencies.

The problem is that currently (but you never know about the future ;-) ) there isn’t a dotNet native port of Ivy.

This can be solved using the exec tag from your NAnt script and using java as an external program.
Here is the bit to add to your NAnt build script:

<target name=\”dependencies\” description=\”resolves project dependencies\”>
<exec program=\”java.exe\”>
<arg value=\”-classpath\” />
<arg>
<path>
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/ivy-2.0.0-beta2.jar\” />
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/ivy-core-2.0.0-beta2.jar\” />
<pathelement file=\”tools/apache-ivy-2.0.0-beta2/lib/commons-cli-1.0.jar\” />
</path>
</arg>
<arg value=\”org.apache.ivy.Main\” />
<arg value=\”-settings\” />
<arg>
<path>
<pathelement file=\”ivysettings.xml\” />
</path>
</arg>
<arg value=\”-retrieve\” />
<arg>
<path>
<pathelement dir=\”lib/[module].[artifact].[ext]\” />
</path>
</arg>
</exec>
</target>

4 responses

Hi Luca, have you had a look at maven (maven.apache.org).

Stefano Fornari | April 24, 2008

Hi Luca, have you had a look at maven (maven.apache.org). It is just great, even if you’ll have the same issue with .net

Hi Stefano, I haven't actually tried Maven but Maven itself

Luca | April 25, 2008

Hi Stefano, I haven’t actually tried Maven but Maven itself uses Ivy as dependency manager, so I’m sure it works pretty well.

Where did you get the information that maven uses Ivy

Stefano Fornari | April 26, 2008

Where did you get the information that maven uses Ivy as dependency manager? I do not actually think so. BTW, maven is much more than a dependency manager. To me Maven stays to programming languages like OOP stays to procedural languages. You can find more information on Ivy vs Maven2 in the links below, but if you are dealing with a complex project structure, I really suggest you spend some time to play with Maven.

http://docs.codehaus.org/display/MAVEN/Feature+Comparisons
http://ant.apache.org/ivy/m2comparison.html

Ste

Stefano you're actually right ! I did some additional researches and

Luca | April 27, 2008

Stefano you’re actually right !

I did some additional researches and Maven is not using Ivy as dependency manager; not sure from where that idea came from, but I was wrong.

Thank you for the hint.

Leave a comment

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