Partner – Microsoft – NPI (cat= Spring)
announcement - icon

Azure Spring Apps is a fully managed service from Microsoft (built in collaboration with VMware), focused on building and deploying Spring Boot applications on Azure Cloud without worrying about Kubernetes.

And, the Enterprise plan comes with some interesting features, such as commercial Spring runtime support, a 99.95% SLA and some deep discounts (up to 47%) when you are ready for production.

>> Learn more and deploy your first Spring Boot app to Azure.

You can also ask questions and leave feedback on the Azure Spring Apps GitHub page.

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.

Course – LS (cat=Spring)

Get started with Spring and Spring Boot, through the Learn Spring course:

>> THE COURSE
res – Maven (eBook) (cat=Maven)
Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.