user51
user51

Reputation: 10143

Gradle configuration to use maven local repository

I have Maven and Gradle both installed in my system.

By default maven stores the dependency jars in the USER_HOME/.m2/repository and Gradle stores in folder USER_HOME/.gradle/caches/modules-2 respectively.

For the same project, I am end up with 2 copies of jars in my system ultimately.

Is there any configuration to set up in the gradle at global level so that it uses existing maven repository instead of its own.

Thanks in advance.

Upvotes: 8

Views: 13350

Answers (1)

marok
marok

Reputation: 2146

You can use

mavenLocal()

If location of repository must be in other place you can use

repositories {
    maven {
        url '/path/to/your/repository'
    }
}

Upvotes: 10

Related Questions