It was quite hard to find that a simple system property can change what is the default local maven repository to push to. Simply use the system property

-Dmaven.repo.local=path_to_the_local_m2_repository

It is useful when using this on CI servers without modifying the build.gradle and it works without any customizations.