Spring Milestone and Snapshot Maven Repositories

Published
Updated

If you want to access milestone releases, snapshots, nightly builds, and release candidates, you will need some extra configuration in your pom.xml file as these aren’t usually published to Maven central. You can access these by adding the following to the main block of your pom.xml file:

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <url>https://repo.spring.io/milestone</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <url>https://repo.spring.io/snapshot</url>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <url>https://repo.spring.io/milestone</url>
    </pluginRepository>
</pluginRepositories>

Adding snapshot versions of Spring dependencies is as easy as adding it to your dependencies:

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-web</artifactId>
    <version>5.6.0-SNAPSHOT</version>
</dependency>

You can also add milestone versions of dependencies like so:

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-web</artifactId>
    <version>5.6.0-M1</version>
</dependency>

You are also free to browse the Spring artifactory and explore different versions of builds, snapshots, and milestones that are available.

View spring maven dependency versions of milestones and snapshots

Could not transfer artifact org.springframework 308 Permanent Redirect

If you get a 308 Permanent Redirect error or have issues with transferring artifacts from the Spring milestone and snapshot repositories, check to make sure your URLs are prefixed with https:// instead of http://.