1. Overview

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.

2. Maven Releases

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:

<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.

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

3. Maven Milestones and Release Candidates

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

<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:

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

4. Maven Snapshots

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

<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:

<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

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:

<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:

<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.

6. Conclusion

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.