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 david herviou <da...@gmail.com> on 2010/04/28 17:44:04 UTC

DefaultConfMapping failure

Hello,

I'm encountering a problem while using the defaultconfmapping inside my
module descriptor:
Just consider the descriptor below :

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
http://ant.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="org" module="modulename />

  <configurations defaultconfmapping="compile->default;default->default">
    <conf name="default" description="Default configuration for this
module"/>
    <conf name="compile" visibility="private" description="Compile time
dependencies"/>
  </configurations>

  <dependencies>
    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
conf="compile" transitive="false"/>
  </dependencies>

</ivy-module>

When parsing the line on servlet-api dependency I was expected to have the
conf="compile" changed into conf="compile->default".
But its seems to be not the case, because while I'm retrieving the
conf="compile" I'm also having the gwt dependencies.

Then, I decided to change the previous module descriptor into something like
below (which is --according to ivy documentation-- the same) :
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
http://ant.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="org" module="modulename />

  <configurations defaultconfmapping="default->default">
    <conf name="default" description="Default configuration for this
module"/>
    <conf name="compile" visibility="private" description="Compile time
dependencies"/>
  </configurations>

  <dependencies>
    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
conf="compile->default" transitive="false"/>
  </dependencies>

</ivy-module>

But I have to resign myself that this is not the same because in that case I
do not have the gwt dependencies while I'm retrieving the conf="compile" ...

Has someone any explanations ? or just may be bug?

Thanks.

Re: DefaultConfMapping failure

Posted by david herviou <da...@gmail.com>.
I will take care to specify a conf by default in each dependencies in order
not to have this kind of behavior.
Thanks !

2010/4/28 Maarten Coene <ma...@yahoo.com>

> I think the behaviour is correct.
> - In your first example you get the gwt dependencies because you didn't
> specify the conf attribute on them, so Ivy will use the defaultconfmapping
> value for them. Since this defaultconfmapping contains the compile->default
> configuration, you will get the default gwt dependencies.
> - In your second example, you didn't specify the compile->default any
> longer in the defaultconfmapping, so Ivy will use the "default->default"
> conf for them. When you are resolving the compile configuration, the gwt
> dependencies will not get resolved because of this.
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: david herviou <da...@gmail.com>
> To: ivy-user@ant.apache.org
> Sent: Wed, April 28, 2010 5:44:04 PM
> Subject: DefaultConfMapping failure
>
> Hello,
>
> I'm encountering a problem while using the defaultconfmapping inside my
> module descriptor:
> Just consider the descriptor below :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
> http://ant.apache.org/ivy/schemas/ivy.xsd">
>
>  <info organisation="org" module="modulename />
>
>  <configurations defaultconfmapping="compile->default;default->default">
>    <conf name="default" description="Default configuration for this
> module"/>
>    <conf name="compile" visibility="private" description="Compile time
> dependencies"/>
>  </configurations>
>
>  <dependencies>
>    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
>    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
>    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
> conf="compile" transitive="false"/>
>  </dependencies>
>
> </ivy-module>
>
> When parsing the line on servlet-api dependency I was expected to have the
> conf="compile" changed into conf="compile->default".
> But its seems to be not the case, because while I'm retrieving the
> conf="compile" I'm also having the gwt dependencies.
>
> Then, I decided to change the previous module descriptor into something
> like
> below (which is --according to ivy documentation-- the same) :
> <?xml version="1.0" encoding="UTF-8"?>
> <ivy-module version="2.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
> http://ant.apache.org/ivy/schemas/ivy.xsd">
>
>  <info organisation="org" module="modulename />
>
>  <configurations defaultconfmapping="default->default">
>    <conf name="default" description="Default configuration for this
> module"/>
>    <conf name="compile" visibility="private" description="Compile time
> dependencies"/>
>  </configurations>
>
>  <dependencies>
>    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
>    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
>    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
> conf="compile->default" transitive="false"/>
>  </dependencies>
>
> </ivy-module>
>
> But I have to resign myself that this is not the same because in that case
> I
> do not have the gwt dependencies while I'm retrieving the conf="compile"
> ...
>
> Has someone any explanations ? or just may be bug?
>
> Thanks.
>
>
>
>
>

Re: DefaultConfMapping failure

Posted by Maarten Coene <ma...@yahoo.com>.
I think the behaviour is correct.
- In your first example you get the gwt dependencies because you didn't specify the conf attribute on them, so Ivy will use the defaultconfmapping value for them. Since this defaultconfmapping contains the compile->default configuration, you will get the default gwt dependencies.
- In your second example, you didn't specify the compile->default any longer in the defaultconfmapping, so Ivy will use the "default->default" conf for them. When you are resolving the compile configuration, the gwt dependencies will not get resolved because of this.

Maarten




----- Original Message ----
From: david herviou <da...@gmail.com>
To: ivy-user@ant.apache.org
Sent: Wed, April 28, 2010 5:44:04 PM
Subject: DefaultConfMapping failure

Hello,

I'm encountering a problem while using the defaultconfmapping inside my
module descriptor:
Just consider the descriptor below :

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
http://ant.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="org" module="modulename />

  <configurations defaultconfmapping="compile->default;default->default">
    <conf name="default" description="Default configuration for this
module"/>
    <conf name="compile" visibility="private" description="Compile time
dependencies"/>
  </configurations>

  <dependencies>
    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
conf="compile" transitive="false"/>
  </dependencies>

</ivy-module>

When parsing the line on servlet-api dependency I was expected to have the
conf="compile" changed into conf="compile->default".
But its seems to be not the case, because while I'm retrieving the
conf="compile" I'm also having the gwt dependencies.

Then, I decided to change the previous module descriptor into something like
below (which is --according to ivy documentation-- the same) :
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="
http://ant.apache.org/ivy/schemas/ivy.xsd">

  <info organisation="org" module="modulename />

  <configurations defaultconfmapping="default->default">
    <conf name="default" description="Default configuration for this
module"/>
    <conf name="compile" visibility="private" description="Compile time
dependencies"/>
  </configurations>

  <dependencies>
    <dependency org="com.google.gwt" name="gwt-dev" rev="2.0.3" />
    <dependency org="com.google.gwt" name="gwt-user" rev="2.0.3"/>
    <dependency org="javax.servlet" name="servlet-api" rev="2.5"
conf="compile->default" transitive="false"/>
  </dependencies>

</ivy-module>

But I have to resign myself that this is not the same because in that case I
do not have the gwt dependencies while I'm retrieving the conf="compile" ...

Has someone any explanations ? or just may be bug?

Thanks.