How to get local repository location (URI) from within Maven 3.x plugin?
Use Aether as described in this blog post.
/**
* The current repository/network configuration of Maven.
*
* @parameter default-value="${repositorySystemSession}"
* @readonly
*/
private RepositorySystemSession repoSession;
now get the local Repo through RepositorySystemSession.getLocalRepository()
:
LocalRepository localRepo = repoSession.getLocalRepository();
LocalRepository
has a getBasedir()
method, which is probably what you want.