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 Anton Stalnuhhin <An...@webmedia.ee> on 2007/04/09 11:01:09 UTC

Get exact revision for exact library

Hello,
 
I'm sorry, if it is simple, but I couldn't find the answer on it.
Situation is that I have some modules that depends on C rev="2", but I need to get C rev="1".
So I just add into ivy.xml dependency for C rev="1". As I understand, there is a conflict, so
by default Ivy takes latest-revision. How can I configure conflicts, so that if there is a conflict
between C rev="ANY" and C rev="1", Ivy takes C rev="1"?
 
Thanks,
----------------------------------------
Anton Stalnuhhin [5248202]
antons@webmedia.ee

Re: Get exact revision for exact library

Posted by Xavier Hanin <xa...@gmail.com>.
On 4/10/07, Robert Macaulay <ro...@gmail.com> wrote:
>
> On 4/9/07, Anton Stalnuhhin <An...@webmedia.ee> wrote:
> > Well, I thought about all of these solutions. Excluding is very annoying
> here. Project is big. It is not comfortable. Force attribute didn't help, I
> tried it. I thought there is some good and pretty solution with conflict
> management...
>
> I have the exact same requirement. I think its calling for a custom
> something. Something between strict and latest version.
>
> Am I looking for a custom conflict manager? Strict sounds like what we
> want but it doesnt support the ranges.


I'm not sure you have the same case. Anton has a dependency on two different
revisions, and want to select an earlier one. You seems to want to avoid any
real conflict, which is what the strict conflict manager is made for, except
that it doesn't support version ranges, which can be considered as a bug,
and thus should be fixed.

But I may be wrong, you certainly better know what you want than I do :-)

- Xavier


-- 
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Re: Get exact revision for exact library

Posted by Robert Macaulay <ro...@gmail.com>.
On 4/9/07, Anton Stalnuhhin <An...@webmedia.ee> wrote:
> Well, I thought about all of these solutions. Excluding is very annoying here. Project is big. It is not comfortable. Force attribute didn't help, I tried it. I thought there is some good and pretty solution with conflict management...

I have the exact same requirement. I think its calling for a custom
something. Something between strict and latest version.

Am I looking for a custom conflict manager? Strict sounds like what we
want but it doesnt support the ranges.

Re: Get exact revision for exact library

Posted by Xavier Hanin <xa...@gmail.com>.
On 4/9/07, Anton Stalnuhhin <An...@webmedia.ee> wrote:
>
> From: Jing Xue [mailto:jingxue@digizenstudio.com]
> Sent: E 09.04.2007 17:29
> To: ivy-user@incubator.apache.org
> Subject: Re: Get exact revision for exact library
>
> >> I'm sorry, if it is simple, but I couldn't find the answer on it.
> >> Situation is that I have some modules that depends on C rev="2", but
> >> I need to get C rev="1".
> >> So I just add into ivy.xml dependency for C rev="1". As I
> >> understand, there is a conflict, so
> >> by default Ivy takes latest-revision. How can I configure conflicts,
> >>  so that if there is a conflict
> >> between C rev="ANY" and C rev="1", Ivy takes C rev="1"?
> >
> >Hi Anton,
> >
> >I'm fairly new to ivy, so just a couple of thoughts: you can probably
> >either exclude C rev.2 in the other dependency, or use a force
> >attribute on the C rev.1 dependency.  There is also some conflict
> >manager types that can be configured to resolve conflicts the way you
> >wanted - which is probably a universal solution but can be an overkill
> >depending on your situation.
> >
> >HTH.
> >--
> >Jing Xue
>
> Well, I thought about all of these solutions. Excluding is very annoying
> here. Project is big. It is not comfortable.


I don't think excluding is the best solution, but the latest version
supports module wide exclusion which can help. You can also comment on the
related issue if you think that settings wide exclusion could help:
https://issues.apache.org/jira/browse/IVY-431

Force attribute didn't help, I tried it.


Force is only an indication for the conflict manager, and it can be actually
used or not depending on the conflict manager used. But if you use the
default conflict manager (latest-revision), it should work in your
situation. Even if you'd prefer another solution (like a new conflict
manager), it would be nice to see if you've found a bug or if it's only a
settings problem. Could you give more details on what you did (your ivy
files and your settings).

I thought there is some good and pretty solution with conflict management...


There is a solution with conflict management, but as Jing said, it may be
overkill or not depending on the frequency of your situation. If you
frequently need a module to be sure that the revision of a dependency it
will get is X whatever the conflict in dependencies occur, the force
attribute should be the easiest solution, since it has been designed for
that. OTOH, if your problem should better be considered for all your
modules, and you don't want to use the force attribute everywhere, then
using a custom conflict manager should be the best solution. Maybe what you
need is a 'nearest definition' conflict manager. There is no such conflict
manager for the moment, but writing one is possible, and could be
interesting for the Ivy community since it's the way maven 2 deals with
conflicts. So if you think it could help you, at least open a JIRA issue for
that, and if you implement it we would appreciate a patch :-)

- Xavier

----------------------------------------
> Anton Stalnuhhin [5248202]
> antons@webmedia.ee
>
>
>
>
>
>
>


-- 
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

RE: Get exact revision for exact library

Posted by Anton Stalnuhhin <An...@webmedia.ee>.
From: Jing Xue [mailto:jingxue@digizenstudio.com]
Sent: E 09.04.2007 17:29
To: ivy-user@incubator.apache.org
Subject: Re: Get exact revision for exact library

>> I'm sorry, if it is simple, but I couldn't find the answer on it.
>> Situation is that I have some modules that depends on C rev="2", but 
>> I need to get C rev="1".
>> So I just add into ivy.xml dependency for C rev="1". As I  
>> understand, there is a conflict, so
>> by default Ivy takes latest-revision. How can I configure conflicts, 
>>  so that if there is a conflict
>> between C rev="ANY" and C rev="1", Ivy takes C rev="1"?
>
>Hi Anton,
>
>I'm fairly new to ivy, so just a couple of thoughts: you can probably 
>either exclude C rev.2 in the other dependency, or use a force 
>attribute on the C rev.1 dependency.  There is also some conflict 
>manager types that can be configured to resolve conflicts the way you 
>wanted - which is probably a universal solution but can be an overkill 
>depending on your situation.
>
>HTH.
>--
>Jing Xue
 
Well, I thought about all of these solutions. Excluding is very annoying here. Project is big. It is not comfortable. Force attribute didn't help, I tried it. I thought there is some good and pretty solution with conflict management...
 
----------------------------------------
Anton Stalnuhhin [5248202]
antons@webmedia.ee







Re: Get exact revision for exact library

Posted by Jing Xue <ji...@digizenstudio.com>.
Quoting Anton Stalnuhhin <An...@webmedia.ee>:

> Hello,
>
> I'm sorry, if it is simple, but I couldn't find the answer on it.
> Situation is that I have some modules that depends on C rev="2", but  
>  I need to get C rev="1".
> So I just add into ivy.xml dependency for C rev="1". As I   
> understand, there is a conflict, so
> by default Ivy takes latest-revision. How can I configure conflicts,  
>  so that if there is a conflict
> between C rev="ANY" and C rev="1", Ivy takes C rev="1"?

Hi Anton,

I'm fairly new to ivy, so just a couple of thoughts: you can probably  
either exclude C rev.2 in the other dependency, or use a force  
attribute on the C rev.1 dependency.  There is also some conflict  
manager types that can be configured to resolve conflicts the way you  
wanted - which is probably a universal solution but can be an overkill  
depending on your situation.

HTH.
-- 
Jing Xue