You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_This document describes how to access Spring Framework artifacts. For snippets of POM configuration go to Maven Central or Spring Repositories._
_This document describes how to access Spring Framework artifacts. For examples of Maven POM and Gradle dependency configuration see the Maven Central, Spring Repositories, and Spring Boot Dependency Managment sections below._
The Spring Framework is modular and publishes 20+ different jars:
The Spring Framework is modular and publishes 20+ different artifacts (JARs):
Some modules are interdependent. For example `spring-context` depends on `spring-beans` which in turn depends on `spring-core`. There are no required external dependencies although each module has optional dependencies and some of those may be required depending on what functionality the application needs.
Some modules are interdependent. For example `spring-context` depends on `spring-beans` which in turn depends on `spring-core`. There are no required external dependencies, although each module has optional dependencies, and some of those may be required depending on what functionality the application needs.
There is no single "spring-all" jar that includes all modules.
There is no single "spring-all" artifact that includes all modules.
> **NOTE**: The examples in the Maven Central and Spring Repositories sections of this document assume that you are manually configuring individual dependencies on Spring Framework artifacts. However, if you are using a dependency management tool, please consult the documentation for that specific tool. If you are using Spring Boot, please consult the Spring Boot Dependency Managment section at the end of this document.
## Maven Central
The Spring Framework publishes GA (general availability) versions to [Maven Central](https://central.sonatype.com/) which is automatically searched when using Maven or Gradle, so just add the dependencies to your project's build script:
The Spring Framework publishes GA (general availability) versions to [Maven Central](https://central.sonatype.com/) which is automatically searched when using Maven or Gradle, so just add the desired dependencies to your project's build script.
The following demonstrate how to add a dependency on version `6.2.0` of the `spring-context` artifact. Similar configuration can be applied for any of the other Spring Framework artifacts listed above.
Snapshot, milestone, and release candidate versions are published to an [Artifactory](https://www.jfrog.com/artifactory/) instance hosted by [JFrog](https://www.jfrog.com). You can use the Web UI at https://repo.spring.io to browse the Spring Artifactory, or go directly to one of the repositories listed below.
### Snapshots
### Snapshot Repository Configuration
Add the following to resolve snapshot versions – for example, `6.2.1-SNAPSHOT`:
Add the following to enable your build tool to resolve snapshot versions.
#### Maven
Expand All
@@ -56,13 +60,6 @@ Add the following to resolve snapshot versions – for example, `6.2.1-SNAPSHOT`
</releases>
</repository>
</repositories>
...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>6.2.1-SNAPSHOT</version>
</dependency>
```
#### Gradle
Expand All
@@ -74,17 +71,33 @@ repositories {
url "https://repo.spring.io/snapshot"
}
}
```
### Snapshot Dependency Configuration
...
The following demonstrate how to add a dependency on version `6.2.1-SNAPSHOT` of the `spring-context` artifact. Similar configuration can be applied for any of the other Spring Framework artifacts listed above.
### Milestone and Release Candidate Repository Configuration
Add the following to resolve milestone and RC versions – for example, `7.0.0-M1` or `7.0.0-RC1`:
Add the following to enable your build tool to resolve milestone (M) and release candidate (RC) versions.
#### Maven
Expand All
@@ -99,13 +112,6 @@ Add the following to resolve milestone and RC versions – for example, `7.0.0-M
</snapshots>
</repository>
</repositories>
...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>7.0.0-M1</version>
</dependency>
```
#### Gradle
Expand All
@@ -117,11 +123,50 @@ repositories {
url "https://repo.spring.io/milestone"
}
}
```
### Milestone and Release Candidate Dependency Configuration
The following demonstrate how to add a dependency on milestone version `7.0.0-M1` of the `spring-context` artifact. Similar configuration can be applied for any of the other Spring Framework artifacts listed above.
Note that release candidate versions such as `7.0.0-RC1` can be configured in the same manner.
If you need to override the version of a dependency used in your Spring Boot application, you have to override the exact name of the [version property](https://docs.spring.io/spring-boot/appendix/dependency-versions/properties.html#appendix.dependency-versions.properties) defined in the bill of materials (BOM) used by the Spring Boot plugin. For example, the name of the Spring Framework version property in Spring Boot is `spring-framework.version`.
For details on how to change a dependency version using Spring Boot's build plugins, see the official documenation for the [Maven](https://docs.spring.io/spring-boot/maven-plugin/using.html#using.parent-pom) and [Gradle](https://docs.spring.io/spring-boot/gradle-plugin/managing-dependencies.html) build plugins.
The following demonstrate how to configure Spring Boot's build plugins to use version `6.2.0` for all Spring Framework artifacts used in the project. If you have configured support for snapshot, milestone, or release candidate repositories (as explained above), you can substitute `6.2.0` with `6.2.1-SNAPSHOT`, `7.0.0-M1`, `7.0.0-RC1`, and so forth.