I came across gradle publishToMavenLocal
as part of the "maven-publish" plugin which installs a build into the local ~/.m2
folder. Since I am still using gradle uploadArchives
I wonder if there is something similar which would allow to choose between local and remote deployment?
A manual way to configure the local Maven repository is the following:
uploadArchives {
repositories {
mavenDeployer {
repository url: 'file://' + new File(
System.getProperty('user.home'), '.m2/repository').absolutePath
}
}
}
task install(dependsOn: uploadArchives)
I also came up with the idea that whenever the build is uploaded to the remote repository it is installed to the local repository as well. But I am not sure if it is wanted to automate this - comments are welcome.