Maven plugin custom install dir


Is it possible to specify programmatically a Maven local directory when using the Install task provided by the Maven plugin?

The documentation says that a custom folder defined in the Maven settings.xml is taken in consideration by the task, but in my use case I need to specify it from the build script.


I don’t believe this can be set in the build script itself. You can alternatively specify the location via the ‘maven.repo.local’ system property.

gradle install -Dmaven.repo.local=/path/to/repo

It works with that system property.