The first form (maven{}) is more idiomatic. The primary difference between
maven{} and mavenRepo() is that the latter returns the underlying ivy
DependencyResolver instance, which can be manipulated directly. Once we are
happy that maven{} supports all of the reasonable use cases for dependency
resolution, mavenRepo will likely be deprecated.

The reason for this change is that we are moving away from exposing ivy as
part of our API. The motivation is that we want to be able to provide a
richer, more domain-specific api for dependency resolution, and not be tied
to the ivy API or implementation.

One benefit to the maven{} syntax is that it provides the ability to
lazy-evaluate the url (and other) parameters, whereas the url parameter of
mavenRepo must be know at the time of declaring the repository.

cheers
Daz

On 2 December 2011 11:24, Russel Winder <[email protected]> wrote:

> Quick question as to whether one form is more idiomatic than the other:
>
>        repositories {
>                mavenCentral ( )
>                maven { url 'http://repository.codehaus.org/' }
>        }
>
> or
>
>        repositories {
>                mavenCentral ( )
>                mavenRepo url : 'http://repository.codehaus.org/'
>        }
>
> Thanks.
>
> --
> Russel.
>
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip:
> sip:[email protected]
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [email protected]
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
>



-- 
Darrell (Daz) DeBoer
Principal Engineer, Gradleware
http://www.gradleware.com

Reply via email to