Add support for specifying the local maven repo with "maven.repo.local"

Continuing the discussion from Specify local maven repo without changing settings.xml:

I’d also like to see support for a more flexible way to specify the local maven repo. Mostly to be able to provide my own snapshot repository by simply exporting the directory via http(s). Is it possible to create a ticket for this at issues.gradle.org?

You can in fact specify the location of maven local using the maven.repo.local system property.

According to your fellow Core Dev Rene, this is not possible. I tried gradle install -Dmvn.repo.local=/tmp and it did not work, i.e. the artifacts where still installed on the default maven local repo (IIRC ~/.m2/repo or something like that).

This seems to be an issue with the ‘maven’ plugin. The system property works properly during artifact resolution using mavenLocal() or when publishing with the ‘maven-publish’ plugin. I’ve raised GRADLE-3272 to track this. In the mean time you might want to consider using the ‘maven-publish’ plugin instead.

This issue is fixed in Gradle 2.4. Can you try using the latest nightly release and confirm that fixes your problem?

1 Like

I’d be happy to switch to the new ‘maven-publish’ plugin. What hinders me is a detailed migration guide, so I can migrate my project from the ‘maven’ to the ‘maven-publish’ plugin.

That’s great! I will hopefully be able to test and report back. Do you happen to know the commit which is supposed to fix this?

Verified gradle install -Dmaven.repo.local=/some/path with the 2.4-NIGHTLY will install the artifacts in /some/path. Thanks

There’s no migration guide per-se, but you should be able to get the info you need from the user guide.