Maven 如何知道要访问和检查哪些远程存储库?

How Maven knows what remote repositories to access and check?

假设我正在向我的 Maven 项目添加 Spring 依赖项: http://mvnrepository.com/artifact/org.springframework/spring-core/4.2.1.RELEASE

我的pom.xml,将添加以下内容:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.2.1.RELEASE</version>
</dependency>

我的 Maven 如何知道从哪里获取工件?除了我们的企业 Artifactory 存储库之外,我没有在 maven settings.xml 中设置任何东西。

有几个官方的中央存储库和代理。 (参见 documentation)Maven 默认知道它们。

在您的 settings.xml 中指定一些内容只会将一些内容添加到列表中。

通过中央存储库进行搜索的便捷方法是转到:search.maven.org