You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Costin Caraivan <cc...@axway.com> on 2009/01/12 17:04:08 UTC

How to get path to the local repository?

I tried:
Settings set = new Settings();
set.getLocalRepository(); 
gives me null (probably because I don't have an explicit path in the
settings.xml file).

I also tried:
ArtifactRepository localRepo;
localRepo.getBasedir();
but this doesn't work.


How do I get the path to the local repository? I'm sure that Maven computes
it, because a ${settings.LocalRepository} property in a pom file gets the
right path.

Any clues?

Regards,
Costin.
-- 
View this message in context: http://www.nabble.com/How-to-get-path-to-the-local-repository--tp21417315p21417315.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: How to get path to the local repository?

Posted by John Casey <jd...@commonjava.org>.
If you're injecting this information into a plugin parameter, you can 
use the expression '${localRepository}' to get the ArtifactRepository 
instance, then call getBasePath() from that, IIRC.



Costin Caraivan wrote:
> I tried:
> Settings set = new Settings();
> set.getLocalRepository(); 
> gives me null (probably because I don't have an explicit path in the
> settings.xml file).
> 
> I also tried:
> ArtifactRepository localRepo;
> localRepo.getBasedir();
> but this doesn't work.
> 
> 
> How do I get the path to the local repository? I'm sure that Maven computes
> it, because a ${settings.LocalRepository} property in a pom file gets the
> right path.
> 
> Any clues?
> 
> Regards,
> Costin.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org