ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cody Casterline <cody.casterl...@gmail.com>
Subject Building a Repo -- Excludes Question
Date Tue, 24 May 2011 23:11:42 GMT
I'm looking into switching to Ivy for managing our dependencies and I was
happy to find this page:
http://ant.apache.org/ivy/history/latest-milestone/tutorial/build-repository.html
which describes how to create a local repository using ivy:install so that
builds don't have to hit the network.  (Yay!)

I grabbed
https://svn.apache.org/repos/asf/ant/ivy/core/trunk/src/example/build-a-ivy-repositoryand
started tweaking it to test my understanding, but I'm running into a
couple issues.

First, my dependencies:

        <dependencies>
                <dependency org="commons-io" name="commons-io" rev="1.4"/>
                <dependency org="org.apache.cxf"
name="cxf-rt-frontend-jaxws" rev="2.4.0">
                <!--
                        <exclude org="javax.activation"/>
                -->
                </dependency>
        </dependencies>


I've also switched ivysettings-basic.xml to use the local repository
('my-repository') by default.  (It doesn't seem that ivy:resolve or
ivy:retrieve accept a resolver name as an option?  is ivy:install the only
place where you can specify resolvers by name?)

<ivysettings>
        <settings       defaultCache="${ivy.cache.dir}/no-namespace"
                        defaultResolver="my-repository"
                        defaultConflictManager="all" />
        <resolvers>
                <filesystem name="my-repository">
                        <ivy
pattern="${dest.repo.dir}/no-namespace/[organisation]/[module]/ivys/ivy-[revision].xml"/>
                        <artifact
pattern="${dest.repo.dir}/no-namespace/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
                </filesystem>
                <ibiblio name="libraries" m2compatible="true" />
        </resolvers>
</ivysettings>

My thinking is that I can define my dependencies, then try a build.  if the
build can't resolve a dependency from my local repo, I can run ivy:install
to install that dep. locally and try again.  This way I can iteratively
build up my local repo.

when I run ivy:install on org.apache.cxf#cxf-rt-frontend-jaxws;2.4.0, it
installs lots of dependencies but fails with:

[ivy:install] :: problems summary ::
[ivy:install] :::: WARNINGS
[ivy:install]           [NOT FOUND  ]
javax.activation#activation;1.0.2!activation.jar (128ms)
[ivy:install]   ==== libraries: tried
[ivy:install]
http://repo1.maven.org/maven2/javax/activation/activation/1.0.2/activation-1.0.2.jar
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install]           ::              FAILED DOWNLOADS            ::
[ivy:install]           :: ^ see resolution messages for details  ^ ::
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:install]           :: javax.activation#activation;1.0.2!activation.jar
[ivy:install]           ::::::::::::::::::::::::::::::::::::::::::::::

... despite the fact that when I look at the ivy files in my repo, and the
pom files on maven.org, they claim to exclude javax.activation.

If I uncomment the extra exclude rule above, ivy:resolve will work.  Why
does my exclude work where the ones in pom and ivy files didn't?

Also, while I've got everyone's attention, is there an easier way to just
tell Ivy to install all dependencies for a project into a repository?   If
I've got them listed in ivy.xml, entering them manually into ivy:install
commands seems redundant.  :)

Thanks!

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