ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: confmappingoverride does not override
Date Mon, 22 Sep 2008 21:07:39 GMT
Martin,

I think the behaviour you see is normal.
Please see http://ant.apache.org/ivy/history/latest-milestone/ivyfile/configurations.html
(the example at the bottom of the page)
I must admit that the name of the attribute is a bit misleading here.

So, lets take a look at your example:
After parsing your ivy.xml file, Ivy has internally transformed your dependencies to:

<dependencies>
    <dependency org="jgoodies" name="binding" conf="default->default;src->#" rev="2.0.4"/>
</dependencies>

So, when you resolve the "src" configuration, Ivy will get the "src" config of jgoodies-binding,
and also the "default" config because your src config extends the default config.

I think the following could solve your problem (I didn't test it though)

<ivy-module version="1.4">
<info organisation="me" module="ivy-test"/>
<configurations
    confmappingoverride="true"
    defaultconfmapping="default,src->#">
    <conf name="default" visibility="public"/>
    <conf name="src" visibility="private" extends="*"/>
</configurations>

<dependencies>
    <dependency org="jgoodies" name="binding" conf="default" rev="2.0.4"/>
</dependencies>
</ivy-module>


Maarten




----- Original Message ----
From: Martin Ficker <m.ficker@googlemail.com>
To: ivy-user@ant.apache.org
Sent: Monday, September 22, 2008 11:58:21 AM
Subject: Re: confmappingoverride does not override

Hi,

To keep thingh simple I removed the unittest part of the example.
My ivy file (Using both conmappingoverride="true" and "src->#").

<ivy-module version="1.4">
<info organisation="me" module="ivy-test"/>
<configurations
    confmappingoverride="true"
    defaultconfmapping="src->#">
    <conf name="default" visibility="public"/>
    <conf name="src" visibility="private" extends="*"/>
</configurations>

<dependencies>
    <dependency org="jgoodies" name="binding" conf="default" rev="2.0.4"/>
</dependencies>
</ivy-module>

The binding ivy file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="1.4">
    <info
        organisation="jgoodies"
        module="binding"
        revision="2.0.4"
        status="release">
        <license name="BSD"/>
        <description homepage="https://binding.dev.java.net/">
            Bind domain data to Swing components.
            The JGoodies Binding library connects object properties to Swing
user interface components. And it helps you represent the state and behavior
of a presentation independently of the GUI components used in the interface.
        </description>
    </info>
    <configurations>
        <conf name="default"/>
        <conf name="src" description="The ziped source of this project"/>
        <conf name="example" extends="default"/>
    </configurations>

    <publications>
        <artifact conf="default"/>
        <artifact name="binding-src" type="source" ext="zip" conf="src"/>
    </publications>

    <dependencies>
        <dependency org="jgoodies" name="forms" rev="1.2.0"
conf="example->default"/>
    </dependencies>

</ivy-module>

My Buildfile (Striped down to the very basic. The problem still remains)

<?xml version="1.0" encoding="UTF-8"?>
<project name="ivy-test" default="retrieve" basedir="."
xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
xmlns:antcontrib="antlib:net.sf.antcontrib">

    <target name="retrieve">
        <delete dir="lib"/>
        <ivy:configure/>
        <ivy:retrieve pattern ="lib/[conf]/[artifact].[ext]"/>

    </target>
</project>

Expected outcome of  "ant"
lib
   default
       binding.jar
   src
      binding-src.jar

actual:
  lib
    default
       binding.jar

   src
      binding.jar
      binding-src.jar


"#" doesn't work event in this simple ivy.xm (remember I'm using 1.4). So
this part of the problem has nothing to to with
default config:
<configurations>
    <conf name="default" visibility="public"/>
    <conf name="src" visibility="private" extends="*"/>
</configurations>

<dependencies>
    <dependency org="jgoodies" name="binding" conf="default;src->#"
rev="2.0.4"/>
</dependencies>



Best regards

Martin



2008/9/21 Maarten Coene <maarten_coene@yahoo.com>

> It's hard to tell what's going on without knowing the ivy.xml files of your
> binding and easymock module.
> Could you post them here?
> Could you also post the part of your build.xml where you do the resolve?
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: Martin Ficker <m.ficker@googlemail.com>
> To: ivy-user@ant.apache.org
> Sent: Sunday, September 21, 2008 5:04:11 PM
> Subject: Re: confmappingoverride does not override
>
> Thanks for the reply.
> src-># without  confmapping results in only binding.jar and easmyock.jar
> withing the "src" dir.
> The ivy:report tells me they are required in configuration default
> repsectivly unittest.
>
> Looks like "#" doenst work correct when used in defaultconfigmapping?
>
> Martin
>
>
> 2008/9/20 Gilles Scokart <gscokart@gmail.com>
>
> > I never tried it myself, but you can maybe try to use a defaultmapping
> > "src->#"
> > With this, I'm not even sure you will need confmappingoverride.
> >
> > Keep us informed of the result.
> >
> >
> >
> > 2008/9/19 Martin Ficker <m.ficker@googlemail.com>:
> > > Hello Everybody,
> > >
> > > I would like to have a "src" configuration that retrieves all
> > dependencies
> > > in their src configuration, but I can't find
> > > a solution. I'm usin ivy 1.4.
> > > Here is what I tried so far:
> > >
> > > from ivy.xml:
> > > <configurations
> > >    confmappingoverride="true"
> > >    defaultconfmapping="unittest->default;src->src">
> > >    <conf name="default" visibility="public"/>
> > >    <conf name="unittest"  visibility="private"/>
> > >    <conf name="src" visibility="private" extends="*"/>
> > > </configurations>
> > >
> > > <dependencies>
> > >    <dependency org="jgoodies" name="binding" conf="default"
> rev="2.0+"/>
> > >    <dependency org="easymock" name="easymock" conf="unittest"
> rev="2.3"/>
> > > </dependencies>
> > >
> > >
> > > After a resolve my lib dir looks like
> > >
> > > default
> > >    binding.jar
> > > unittest
> > >    easymock.jar
> > > src
> > >     binding-src.jar
> > >     binding.jar <----------------I don't want this
> > >     easymock-src.jar
> > >     easymock.jar <------------ I don't want this
> > >
> > >
> > > It seems despite it's name and documentation  setting
> > > conmappingoverride="true" the "src" mappingdoes not
> > > override but add to the dependency mapping.
> > >
> > > Any suggestions are welcome.
> > >
> > > Best regards
> > > Martin
> > >
> >
> >
> >
> > --
> > Gilles Scokart
> >
>
>
>
>
>



      

Mime
View raw message