简体   繁体   English

什么是Android Studio中的Maven存储库?

[英]What is Maven repository in Android Studio?

Can anyone explain clairly what is Maven repository in Android Studio ? 谁能巧妙解释Android Studio中的Maven repository是什么? 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. 上一次我需要在项目中添加一些依赖项,直到我在build.gradle文件中添加了指向Maven and Jcenter的链接,这些依赖项才起作用。

It worked parfectly but my question is just to know What is exactly maven and Jcenter in Android Studio ? 它完美地工作了,但我的问题只是想知道Android Studio中到底是什么Maven和Jcenter? Thanks in advance with your answers. 预先感谢您的回答。

A maven repository is a "repo", public or private, to store libraries, plugins and in general artifacts. Maven存储库是公共或私有的“仓库”,用于存储库,插件和一般工件。
It is not related to Android Studio or another IDE. 它与Android Studio或其他IDE不相关。

JCenter is one of the maven repo. JCenter是Maven 仓库之一。

JCenter is the place to find and share popular Apache Maven packages for use by Maven, Gradle, Ivy, SBT, etc. JCenter是查找和共享流行的Apache Maven软件包的地方,供Maven,Gradle,Ivy,SBT等使用。

Other common repo used in Android are: Android中使用的其他常见回购协议是:

In a gradle script you can find them in the repositories block: gradle脚本中,您可以在repositories块中找到它们:

/**
     * 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: 我不是Java家伙,但来自Google的快速查找:

Maven is build and dependency management tool (helps in building project and downloading dependencies). Maven是构建和依赖项管理工具(有助于构建项目和下载依赖项)。

Jcenter looks like repository of available libraries (is source for all dependencies downloaded by maven processes). Jcenter看起来像可用库的存储库(是maven进程下载的所有依赖项的源)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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