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
Brian Clozel edited this page Jun 12, 2025
·
33 revisions
This document describes how to build the Spring Framework from the command line
and how to import the Spring Framework projects into an IDE. You may also be
interested to see Code Style and IntelliJ IDEA Editor Settings.
The Spring Framework uses a Gradle build. The instructions below
use the Gradle Wrapper from the root of the source tree.
The wrapper script serves as a cross-platform, self-contained bootstrap mechanism
for the build system.
For users of SDKMAN, Spring Framework provides .sdkmanrc files that configures the current Java version in your console.
Simply use sdk env to do so.
This command is also available in the 6.2 branch, which uses JDK 17.
Get the Source Code
git clone git@github.com:spring-projects/spring-framework.git
cd spring-framework
Build from the Command Line
To compile, test, and build all jars, distribution zips, and docs use:
./gradlew build
The first time you run the build it may take a while to download Gradle and all build dependencies, as well as to run all tests. Once you've bootstrapped a Gradle distribution and downloaded dependencies, those are cached in your $HOME/.gradle directory.
Gradle has good incremental build support, so run without clean to keep things snappy. You can also use the -a flag and the :<project> prefix to avoid evaluating and building other modules. For example, if iterating over changes in spring-webmvc, run with the following to evaluate and build only that module:
./gradlew -a :spring-webmvc:test
Install in local Maven repository
If you need to publish Spring Framework artifacts locally for testing, you can do the following:
./gradlew pTML -PskipDocs
pTML is an abbreviation for the publishToMavenLocal task. The skipDocs property will skip the "documentation" and "distribution" tasks (typically, the javadoc, kdoc and zip artifacts for docs in general). This can be useful for local iterations, but it is advised to run the full build before submitting a Pull Request.
To install all Spring Framework jars in your local Maven repository, use the following.
./gradlew publishToMavenLocal
Import into your IDE
Ensure JDK 17 is configured properly in the IDE.
Follow the instructions for Eclipse and IntelliJ IDEA.