Build from Source
Pages 24
-
LoadingHome
-
Loadingautorepo version updating
-
LoadingBuild Zip with Dependencies
-
LoadingCode Style
-
LoadingGit branch management
-
LoadingGraalVM native image support
-
LoadingHTTP 2 support
-
LoadingIntelliJ IDEA Editor Settings
-
LoadingLogging
-
LoadingManually merging pull requests
-
LoadingMergedAnnotation API internals
-
LoadingMicro Benchmarks
-
LoadingRelease Process
-
LoadingSpring Artifactory
-
LoadingSpring Framework 5 FAQ
-
LoadingSpring Framework Artifacts
-
LoadingSpring Framework Versions
-
LoadingUpgrading to JDK 17
Clone this wiki locally
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.
Before You Start
To build you will need Git and
JDK 17. Be sure that your JAVA_HOME
environment variable points to the jdk17 folder extracted from the JDK download.
Get the Source Code
git clone git@github.com:spring-projects/spring-framework.git
cd spring-frameworkBuild from the Command Line
To compile, test, and build all jars, distribution zips, and docs use:
./gradlew buildThe 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:testInstall in local Maven repository
To install all Spring Framework jars in your local Maven repository, use the following.
Note that the -x ... arguments skip the generation of documentation.
./gradlew publishToMavenLocal -x api -x asciidoctor -x asciidoctorPdfIf you are building a previous version of the framework (for example, Spring Framework 5.1.x), use:
./gradlew install -x javadocImport into your IDE
Ensure JDK 17 is configured properly in the IDE. Follow instructions for Eclipse and IntelliJ IDEA.

