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.
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.
Maven central repository is located on the web. It has been created by the apache maven community itself. The path of central repository is: http://repo1.maven.org/maven2/. The central repository contains a lot of common libraries that can be viewed by this url http://search.maven.org/#browse.
You can use
mavenLocal()
If location of repository must be in other place you can use
repositories {
maven {
url '/path/to/your/repository'
}
}
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