I usually do it like:
if (hasProperty('repo')) {
localRepo=repo
}
else {
localRepo="file://" + System.getProperty('user.home') +
"/.m2/repository/"
}
and later
repositories {
mavenRepo urls: localRepo
// maybe some other repos here
}
This way by default it will assume that the local repo is in the
default location (on Linux) and if this is not the case you simply add
a param during execution, like:
gradle someTask -Prepo=path/to/repo
(this is what I need to do on our CI server where path to repo is non-standar)
--
Regards / Pozdrawiam
Tomek Kaczanowski
2010/9/23 Rolf Suurd <[email protected]>:
> Hey Neeraj,
>
>
>
> If it is an actual Maven repository:
>
>
>
> repositories {
>
> mavenRepo name: 'local', urls: 'file:///drive:/path/to/maven/repository'
>
> }
>
>
>
> Greets Rolf
>
>
>
> Van: Neeraj Malik [mailto:[email protected]]
> Verzonden: woensdag 22 september 2010 10:07
> Aan: [email protected]
> Onderwerp: Re: [gradle-user] How to use local repository instead of remote
>
>
>
> Hi,
>
> How to use local repository instead of remote repository using gradle.
> Like in maven you can do using mvn -o.
>
> Thanks.
> NM
>
>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 9.0.851 / Virusdatabase: 271.1.1/3148 - datum van uitgifte: 09/22/10
> 00:15:00
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email