简体   繁体   中英

What is Maven repository in Android Studio?

Can anyone explain clairly what is Maven repository in Android Studio ? I try to understand it but I don't find better explainations. Last time I needed to add some dependencies in my project and they didn't work untill I added a link to Maven and Jcenter in my build.gradle file.

It worked parfectly but my question is just to know What is exactly maven and Jcenter in Android Studio ? Thanks in advance with your answers.

A maven repository is a "repo", public or private, to store libraries, plugins and in general artifacts.
It is not related to Android Studio or another IDE.

JCenter is one of the maven repo.

JCenter is the place to find and share popular Apache Maven packages for use by Maven, Gradle, Ivy, SBT, etc.

Other common repo used in Android are:

In a gradle script you can find them in the repositories block:

/**
     * The repositories block configures the repositories Gradle uses to
     * search or download the dependencies. Gradle pre-configures support for remote
     * repositories such as JCenter, Maven Central, and Ivy. You can also use local
     * repositories or define your own remote repositories. The code below defines
     * JCenter as the repository Gradle should use to look for its dependencies.
     *
     * New projects created using Android Studio 3.0 and higher also include
     * Google's Maven repository.
     */
repositories {
        google()
        jcenter()
    }

Im not Java guy but from fast lookup in google:

Maven is build and dependency management tool (helps in building project and downloading dependencies).

Jcenter looks like repository of available libraries (is source for all dependencies downloaded by maven processes).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM