On 2/23/07, Ross Gardler <[EMAIL PROTECTED]> wrote:
Xavier Hanin wrote:
> On 2/23/07, Ross Gardler <[EMAIL PROTECTED]> wrote:
>>
>> Xavier Hanin wrote:
>> > On 2/22/07, Ross Gardler <[EMAIL PROTECTED]> wrote:
>> >>
>> >> At Apache Forrest we are moving towards an ivy managed build system.
>> >> Most of our dependencies come from Cocoon, which uses Maven2. We can
>> >> therefore get the majority of our jars from either:
>> >>
>> >> http://people.apache.org/repository
>> >> or
>> >> http://people.apache.org/maven-snapshot-repository
>> >>
>> >> However, I just can't seem to set up my ivyconf correctly to use
these
>> >> repos. Can someone tell me what the resolver config should look like
>> for
>> >> the above two Maven2 repositories.
>> >
>> >
>> > According to what I see in these repos, it seems that the first one
>> is a
>> > maven 1 repo and the second is a maven2 one. So I think you should be
>> able
>> > to use them like this:
>> >
>> > <ivyconf>
>> > <conf defaultResolver="apache" />
>> > <resolvers>
>> > <chain name="apache">
>> > <ibiblio name="regular"
>> root="http://people.apache.org/repository
>> "
>> > />
>> > <ibiblio name="snapshot" root="
>> > http://people.apache.org/maven-snapshot-repository"
m2compatible="true"
>> />
>> > </chain>
>> > </resolvers>
>> > </ivyconf>
>>
>> OK, I had previously set it up like this:
>>
>> <resolvers>
>> <ibiblio name="regular" root="http://people.apache.org/repository"/>
>> <ibiblio name="snapshot" root="
>> http://people.apache.org/maven-snapshot-repository"
m2compatible="true"/>
>> <chain name="default">
>> <ibiblio name="apache"/>
>> <ibiblio name="snapshot"/>
>> </chain>
>> </resolvers>
>>
>> This was causing the both repositories to go off to the ibiblio
>> repository. I played around with using ivyrep tags and various
>> combinations as well, but always the same effect.
>>
>> Changing to what you suggest above worked just fine.
>>
>> If this stupid user error or a bug? (i.e. wrong assumptions in what I
>> had seen in the docs)
>
>
> Mmm, it's difficult to say, I'd need you whole ivyconf.xml to be sure,
> because with only the resolvers section I can't be sure Ivy was actually
> using your chain.
The original ivyconf.xml can be seen at
http://svn.apache.org/viewvc/forrest/branches/ivyBuild/tools/ivy/ivyconf.xml?revision=506772&view=markup
You're suggestion got us working just fine, so I'm not too worried, but
I'd like to understand the problem.
So do I :-)
But I think I got it now:
<chain name="default" returnFirst="true">
<resolver ref="local" />
<ivyrep name="apache" />
<ivyrep name="apache-snapshot" />
<ivyrep name="ivyrep" />
<ivyrep name="ivyrepsandbox" />
<ibiblio name="ibiblio-maven2" />
</chain>
In your chain you do not reference the resolvers you declare above, but you
create new ones. You should use ref instead of name in the resolvers
declared under the chain:
<chain name="default" returnFirst="true">
<resolver ref="local" />
<ivyrep ref="apache" />
<ivyrep ref="apache-snapshot" />
<ivyrep ref="ivyrep" />
<ivyrep ref="ivyrepsandbox" />
<ibiblio ref="ibiblio-maven2" />
</chain>
Note that you can even declare references without their type:
<chain name="default" returnFirst="true">
<resolver ref="local" />
<resolver ref="apache" />
<resolver ref="apache-snapshot" />
<resolver ref="ivyrep" />
<resolver ref="ivyrepsandbox" />
<resolver ref="ibiblio-maven2" />
</chain>
What could be improved in Ivy is to output a something at least in verbose
mode when you override a resolver definition (give a name for which a
definition already exist). You can open a JIRA issue for that if you want.
Hope things will be clearer now, and enjoy your use of Ivy :-)
- Xavier
Ross