To make my code flexible I would like to find a 开发者_开发技巧way to get the maven 2 repository directory via a function like System.getProperty("m2repo")
or something, as we do for the classpath System.getProperty("java.class.path")
.
Is this possible?
You can inject this value into your Mojo like this:
/**
* @parameter expression="${settings.localRepository}"
*/
private String localRepository;
精彩评论