ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mitch Gitman <mgit...@gmail.com>
Subject Re: Ivy and Maven Repository with nth-level transitive dependencies in POMs
Date Fri, 18 Sep 2009 18:19:21 GMT
Jim, there are two approaches you can take to integrating your Maven
repository.

To build on what Geoff wrote, one is just to consume it directly, as if it
were an Ivy repository, without converting it to an Ivy repository. So in
your ivysettings.xml, you would have an entry like so, replacing the Maven2
public URL with your own Nexus URL:
    <ibiblio name="maven2.resolver" m2compatible="true" root="
http://repo1.maven.org/maven2" />

See:
http://ant.apache.org/ivy/history/trunk/resolver/ibiblio.html

The other approach is to convert your Maven repository into an Ivy
repository. Now, if you're satisfied with the dependencies Maven has
established (if you think Maven has made the right choices about what
library depends on what) and you are using Nexus rather than having to hit
the public Maven 2 repo, then you probably don't need to do the conversion.

But anyway, to convert a Maven repository to an Ivy repository--or rather to
copy certain modules in a Maven repository to an existing Ivy
repository--you would use the ivy:install Ant task. See:
http://ant.apache.org/ivy/history/trunk/use/install.html

The ivy.xml files that get generated are good to go, although if you weren't
satisfied with consuming your Maven repository directly in the first place,
then you probably want to manually massage them.

The reason I'm answering this question myself is because I have a question
myself from running into that very matter of manually massaging the ivy.xml
files generated from a Maven repository. My issue involves all the optional
dependencies that show up in the ivy.xml corresponding to Maven's optional
scope. Actually, this is more of a Maven question because I'm trying to
reverse-engineer Maven's thinking about this. But in Maven, how does one
control optional dependencies for a given module? Do you say, "Give me all
the optional dependencies for module A?" vs. "Give me none?" Can you pick
and choose which optional dependencies you get, and how?

OK, I think I've just put together a question that is better asked on the
maven-user list. But the Ivy part of this question is, how do you translate
optional dependencies into an Ivy paradigm? My suspicion is that this is a
case where Ivy confs come into play, and for lack of having the equivalent
of confs for each optional dependency (or valid combination thereof), Maven
possibly suffers from a certain information loss.

On Fri, Sep 18, 2009 at 11:13 AM, Geoff Clitheroe <g.clitheroe@gmail.com>wrote:

> Hi Jim,
>
> Ivy will use Maven repos (e.g.,
> http://mirrors.ibiblio.org/pub/mirrors/maven2/) and fetch transitive
> dependencies without any additional work (it will read the POMS).
> We've been using it like this with great success.  You will run into
> Maven projects with bad or incorrect POM specs and have to fix them or
> work around them but this tends to be older projects.  Ivy roundup is
> worth a look if this becomes a problem
> http://code.google.com/p/ivyroundup/
>
> Also, some projects may have dependencies in the 'wrong' configuration
> and need a manual exclude:
>
> <dependency org="org.apache.activemq" name="activemq-pool" rev="5.2.0"
> conf="provided->default">
>                <exclude module="spring-beans"></exclude>
>        </dependency>
>
> There are also some things you just can't get from a repo (e.g., some
> DB drivers).  We run our own 'manual' repo for this with hand rolled
> skeleton ivy files.  If you're already using Nexus and caching locally
> then you're well advanced anyway.
>
> Cheers,
> Geoff
>
>
>
> On Sat, Sep 19, 2009 at 5:48 AM, Jim Garrison <Jim.Garrison@troux.com>
> wrote:
> > Ivy newbie here.
> >
> > We have a fairly large project with dependencies on maybe 40 open-source
> packages available from Maven (we have a local Nexus repository for
> caching).
> >
> > Many of these open-source packages have their own dependencies, expressed
> in their POM files.  From reading the Ivy docs, I believe I'm correct in
> stating that those dependencies, and any further transitive dependencies,
> would not be processed by Ivy since Ivy doesn't do POMs.
> >
> > Do I have to hand-build that web of dependencies, to ensure that all the
> required libraries get retrieved, or is there a tool to POM dependencies
> into Ivy files, and maintain them as the underlying POMs change?
> >
> > Thanks in advance
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message