Spring Maven Repositories – Spring Maven Repositories

最后修改: 2013年 5月 19日

1. Overview

1.概述

This article will show what Maven Repositories to use when using Spring artifacts in a project – see the full list of repositories on the Spring wiki. The previous SpringSource artifact management infrastructure was maven.springframework.org – this has now been deprecated in favour of the more powerful repo.spring.io.

本文将介绍在项目中使用Spring工件时应使用哪些Maven资源库–请参阅Spring wiki上的全部资源库列表。以前的SpringSource工件管理基础架构是maven.springframework.org–现在该架构已被弃用,而采用功能更强大的repo.spring.io

2. Maven Releases

2.Maven发布

All the GA/Release artifacts are published to Maven Central, so if only releases are needed, there is no need to add any new repo into the pom. There is however a custom, browsable Maven repository available for Spring Releases as well, if for some reason Central is not available:

所有GA/Release工件都发布到了Maven Central,所以如果只需要发布,就不需要在pom中添加任何新的Repo。不过,如果因为某些原因Central无法使用,也有一个自定义的可浏览 Maven资源库可用于Spring Releases

<repositories>
    <repository> 
        <id>repository.spring.release</id> 
        <name>Spring GA Repository</name> 
        <url>http://repo.spring.io/release</url> 
    </repository>
</repositories>

The Spring artifact versioning rules are explained on the project wiki.

对Spring工件的版本管理规则的解释是项目的维基上

Milestones and Snapshots are not published directly to Maven Central, so these have their own specific repos.

里程碑和快照不会直接发布到Maven中心,所以它们有自己的特定仓库。

3. Maven Milestones and Release Candidates

3.Maven里程碑和候选发布版

For Milestones and RCs, the following repo needs to be added to the pom:

对于里程碑和RCs,需要在pom中加入以下repo。

<repositories>
    <repository> 
        <id>repository.spring.milestone</id> 
        <name>Spring Milestone Repository</name> 
        <url>http://repo.spring.io/milestone</url> 
    </repository>
</repositories>

One this repository has been defined, the project can start using the Spring milestone dependencies:

一旦定义了这个资源库,项目就可以开始使用Spring 里程碑依赖

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.2.0.RC3</version>
</dependency>

4. Maven Snapshots

4.Maven快照

Similar to milestones, Spring Snapshots are hosted in a custom repository:

与里程碑类似,Spring Snapshots也被托管在一个自定义的存储库中。

<repositories>
    <repository> 
        <id>repository.spring.snapshot</id> 
        <name>Spring Snapshot Repository</name> 
        <url>http://repo.spring.io/snapshot</url> 
    </repository>
</repositories>

Once the repository is enabled in the pom, the project can start the using Spring snapshots:

一旦资源库在pom中被启用,项目就可以开始使用Spring快照了。

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.2.5.BUILD-SNAPSHOT</version>
</dependency>

And even:

甚至。

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.0.BUILD-SNAPSHOT</version>
</dependency>

The snapshot repositories can now also be browsed.

快照库现在也可以浏览

5. Maven Repository for Spring OSGI

5.用于Spring OSGI的Maven仓库

OSGI compatible Spring artifacts are maintained in the SpringSource Enterprise Bundle Repository – in short, EBR. These repositories contains valid OSGI bundles and libraries for the entire Spring Framework, as well as a complete set of dependencies for these libraries. For bundles:

与OSGI兼容的Spring工件被维护在SpringSource Enterprise Bundle Repository – 简而言之,EBR。这些资源库包含整个Spring框架的有效OSGI捆绑程序和库,以及这些库的完整依赖关系。对于捆绑程序。

<repository>
    <id>com.springsource.repository.bundles.release</id> 
    <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name> 
    <url>http://repository.springsource.com/maven/bundles/release</url> 
</repository>

<repository> 
    <id>com.springsource.repository.bundles.external</id> 
    <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name> 
    <url>http://repository.springsource.com/maven/bundles/external</url> 
</repository>

And for OSGI compatible libraries:

而对于OSGI兼容的库。

<repository>
    <id>com.springsource.repository.libraries.release</id>
    <name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
    <url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
    <id>com.springsource.repository.libraries.external</id>
    <name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
    <url>http://repository.springsource.com/maven/libraries/external</url>
</repository>

Note: SpringSource EBR is now read-only and no further Spring Framework 3.2.x releases will be published there.

注意:SpringSource EBR现在是只读的,不会再在那里发布Spring Framework 3.2.x版本。

6. Conclusion

6.结论

This article describes the practical information about setting up Spring specific Maven Repositories in the pom – in order to use Release Candidates, Milestones and Snapshots.

本文介绍了在pom中设置Spring特定Maven Repositories的实用信息–以便使用Release Candidates、Milestones和Snapshots。