Actually, I am studying on build.gradle
file. In some cases, I got that sometimes they are using mavenCentral()
, jCenter()
and maven
Actually, all 3 are Maven repository. We use these maven repositories to our build by using its URL address or its location in the local file system.
By using URL:
repositories {
maven { url("https://plugins.gradle.org/m2/") }
}
By using local file system:
repositories {
maven { url '../maven-repo' }
}
Gradle has three “aliases” which we can use when we are adding Maven repositories to our build. These aliases are:
The mavenCentral() alias means that dependencies are fetched from the central Maven 2 repository.
repositories {
mavenCentral()
}
The URL used to access this repository is https://repo.maven.apache.org/maven2/. The name of the repository is MavenRepo.
The jcenter() alias means that dependencies are fetched from the Bintray’s JCenter Maven repository
The mavenLocal() alias means that dependencies are fetched from the local Maven repository.
Gradle: Dependency Management
Maven RepositoryHandler
jcenter() and mavenCentral() is a repository for the Gradle plugin in Android Studio
Earlier versions of Android Studio used mavenCentral(), and after some time, it switched to jcenter.
This is because jcenter() is superior to mavenCentral() in terms of performance and memory footprint:
Resource Link: https://www.jianshu.com/p/bce437eeb3d3