You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Jeff Wang <jw...@responsys.com> on 2008/03/15 02:36:56 UTC

Dependency generation

I'm part of this messy project that's been around for about 10 years.
We've got Ant, and have checked in all of our libraries in our SVN.  I
just want to start with dependency generation first, but it seems like I
need to setup a Maven 2 repository?  Or am I just reading the tutorials
wrong?

 

My basic use case (for now) is to just take my src directory, and figure
out which of the jars that's in my lib directory is actually used.  I
need to figure out what my dependencies are before I can manage it.
After reading the docs, I'm just more confused...

 

Any pointers in the forms of examples or sections of the doc to focus on
would be greatly appreciated.

 

Jeff

PS how well does Ivy identify dependencies such as JDBC drivers, which
tend to be loaded with a forname call, or Spring injected dependencies
via the xml files?


RE: Dependency generation

Posted by Nascif Abousalh-Neto <Na...@sas.com>.
To find the dependencies for a legacy project - in other words, to create an ivy.xml from scratch, which seems to be part of what you need to do - we used a script around a tool called JarJar, hosted at Google Code. You give it a "main" jar and the complete classpath and it generates the dependencies in text format (ready to use with GraphViz). We then processed the output to generate an ivy.xml file compatible with our repository.

That final part is really project specific - it depends on how you map your jars to organizations, modules and artifacts. You can keep it simple and use a 1-to-1 mapping for jars, but for third party jars files usually you have to deal with a 1-to-N mapping of modules to artifacts (jars).

The link for JarJar is http://code.google.com/p/jarjar/
This article explains the idea: http://sixlegs.com/blog/java/depfind.html

HTH,
  Nascif



-----Original Message-----
From: Brown, Carlton [mailto:Carlton.Brown@compucredit.com]
Sent: Friday, March 14, 2008 9:58 PM
To: ivy-user@ant.apache.org
Subject: RE: Dependency generation

 > -----Original Message-----
> From: Jeff Wang [mailto:jwang@responsys.com]
> Sent: Friday, March 14, 2008 9:37 PM
> To: ivy-user@ant.apache.org
> Subject: Dependency generation
>
> I'm part of this messy project that's been around for about 10 years.
> We've got Ant, and have checked in all of our libraries in
> our SVN.  I just want to start with dependency generation
> first, but it seems like I need to setup a Maven 2
> repository?  Or am I just reading the tutorials wrong?

The missing link is that you need a repository.  It can be dirt simple
like a shared network directory, as long as it observes a consistent
layout scheme.  You don't have to use the Maven 2 scheme.  But it's
simple, most of the examples follow that scheme, and a number of useful
tools anticipate it in their defaults, like Archiva.  It's nothing but
organisation/module/revision/artifact.jar.

For your internal repository I suggest reserving the right to be very
creative with organisation to uniquely identify modules, don't just use
com/mycompany and stick everything under that.  You can look at
http://repo1.maven.org/maven2/ and see how different projects have
approached it.  Good luck.

-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on
the contents of this message is prohibited. In such
case please notify us and destroy and delete all
copies of this transmission.  Thank you.
====================================================

RE: Dependency generation

Posted by "Brown, Carlton" <Ca...@compucredit.com>.
 > -----Original Message-----
> From: Jeff Wang [mailto:jwang@responsys.com] 
> Sent: Friday, March 14, 2008 9:37 PM
> To: ivy-user@ant.apache.org
> Subject: Dependency generation
> 
> I'm part of this messy project that's been around for about 10 years.
> We've got Ant, and have checked in all of our libraries in 
> our SVN.  I just want to start with dependency generation 
> first, but it seems like I need to setup a Maven 2 
> repository?  Or am I just reading the tutorials wrong?

The missing link is that you need a repository.  It can be dirt simple
like a shared network directory, as long as it observes a consistent
layout scheme.  You don't have to use the Maven 2 scheme.  But it's
simple, most of the examples follow that scheme, and a number of useful
tools anticipate it in their defaults, like Archiva.  It's nothing but
organisation/module/revision/artifact.jar.

For your internal repository I suggest reserving the right to be very
creative with organisation to uniquely identify modules, don't just use
com/mycompany and stick everything under that.  You can look at
http://repo1.maven.org/maven2/ and see how different projects have
approached it.  Good luck.

-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================