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"
}
}
Best Answer
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 thelocalRepository
definition from the mavensettings.xml
file:The settings.xml should be in either your
M2_HOME/conf
or yourUSER_HOME/.m2 directory
. You should check:M2_HOME
environment variable existssettings.xml
has the correctlocalRepository
defined..