i want to use the maven local repository additionally to a maven remote one. I found the JIRA-Issue http://issues.gradle.org/browse/GRADLE-1173 for that, but adapting my gradle build file in that way some snapshot dependencies which are only available in the local maven repository are still not found. I get an error that the Snapshot-Dependency is not found.
Is it possible to have one local and one remote maven repository?
Here is the relevant part of my gradle build file:
apply plugin: 'maven' repositories { mavenLocal() maven { credentials { username "myusername" password "mypassword" } url "http://myremoterepository" } }
gradle - Gradle does not use the Maven Local Repository for a new dependency - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
Gradle can consume dependencies available in the local Maven repository. Declaring this repository is beneficial for teams that publish to the local Maven repository with one project and consume the artifacts by Gradle in another project. Gradle stores resolved dependencies in its own cache.
I also needed to do a similar setup with my project and I can verify your build.gradle setup works provided your Maven is setup correctly.
Gradle's mavenLocal()
relies on the localRepository
definition from the maven settings.xml
file:
<localRepository>USER_HOME\.m2\repository</localRepository>
The settings.xml should be in either your M2_HOME/conf
or your USER_HOME/.m2 directory
. You should check:
M2_HOME
environment variable exists settings.xml
has the correct localRepository
defined..If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With