spring-projects/spring-framework
Getting started
This page explains how to check out the Spring Framework source, build it, run tests, and import it into an IDE. For dependency-management instructions (how to consume the published artifacts), see the reference documentation.
Prerequisites
- JDK 17+ for compiling most modules. The repository's
.sdkmanrcpinsjava=25-librcafor development; CI also runs Java 21 and 25 (.github/workflows/ci.yml). - Gradle wrapper is included (
gradlew,gradlew.bat). Do not install Gradle separately. - Git to clone the repository.
- ~2 GB heap for the Gradle daemon (
org.gradle.jvmargs=-Xmx2048mingradle.properties). - Toolchains — Gradle's toolchain support automatically downloads the JDK versions referenced in
.github/workflows/ci.ymlif they are missing locally.
Clone
git clone https://github.com/spring-projects/spring-framework.git
cd spring-frameworkBuild
The build is parallel by default (org.gradle.parallel=true).
./gradlew build # compile + test all modules
./gradlew assemble # compile + jar without running tests
./gradlew :spring-core:build # build a single moduleA typical full build runs >2,800 test classes and takes 10–30 minutes depending on hardware. For quicker iteration, target a specific module.
Test
./gradlew test # run all tests
./gradlew :spring-context:test # tests for one module
./gradlew :spring-web:test --tests "*Cors*" # filtered by name patternTest sources live in <module>/src/test/java and <module>/src/test/kotlin. Test fixtures shared between modules use the java-test-fixtures plugin and live in <module>/src/testFixtures/.
Useful Gradle tasks
| Task | Purpose |
|---|---|
./gradlew check |
Tests + Checkstyle + nullability checks |
./gradlew javadoc |
Per-module Javadoc |
./gradlew :framework-api:javadoc |
Aggregated multi-module Javadoc |
./gradlew antora |
Build the Antora reference docs (framework-docs/build/site/index.html) |
./gradlew publishToMavenLocal |
Install snapshot JARs into ~/.m2/repository |
./gradlew clean |
Remove build outputs |
IDE import
Two helper guides live at the repository root:
import-into-intellij-idea.md— how to import the Gradle project into IntelliJ IDEAimport-into-eclipse.md— same for Eclipse, with required settings
The repository's .idea/ directory is committed (project metadata only, not user state) and configures IntelliJ for the project's code style.
Code style and quality gates
- Checkstyle — Custom rules enforced by the
org.springframework.build.conventionsGradle plugin (defined inbuildSrc/). - Nullability — Each module applies
io.spring.nullability, which validates@Nullable/JSpecify annotations. - Code formatting — Conventions documented in the Code Style wiki page.
Running benchmarks
JMH benchmarks live in <module>/src/jmh/. Run them with the me.champeau.jmh plugin:
./gradlew :spring-core:jmhSee the Micro-Benchmarks wiki page for guidance.
What's next
- Module-by-module deep dives: modules/
- Cross-cutting features: features/
- Contribution workflow: how-to-contribute/development-workflow
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.