From 35dd400a25306bbd8523c6b9c3a10a4d5c877f61 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 27 Aug 2019 11:41:00 +0200 Subject: [PATCH] Polishing --- Build-from-Source.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Build-from-Source.md b/Build-from-Source.md index 9326d2b..51cf443 100644 --- a/Build-from-Source.md +++ b/Build-from-Source.md @@ -1,8 +1,9 @@ -_This document describes how to build and import the Spring Framework into an IDE. -You may also be interested to see [[Code Style]] and [[IntelliJ IDEA Editor Settings]]._ +_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](http://gradle.org) build. The instructions below -use [Gradle Wrapper](http://vimeo.com/34436402) from the root of the source tree. +use the [Gradle Wrapper](http://vimeo.com/34436402) from the root of the source tree. The wrapper script serves as a cross-platform, self-contained bootstrap mechanism for the build system. @@ -15,29 +16,34 @@ extracted from the JDK download. ### Get the Source Code -``` +```shell git clone git@github.com:spring-projects/spring-framework.git cd spring-framework ``` ### Build from the Command Line -To compile, test, build all jars, distribution zips, and docs use: -``` +To compile, test, and build all jars, distribution zips, and docs use: + +```shell ./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: -``` +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: + +```shell ./gradlew -a :spring-webmvc:test ``` -The Gradle daemon eliminates startup overhead. It's enabled by default but sometimes you may need to disable it. For example if building against [JDK 9](https://jdk9.java.net/download/), you may encounter an `Unrecognized VM option` error which halts the build. To avoid that error, add `org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m` to the `gradle.properties` file in your _gradle user home_ directory. See also [GRADLE-3256](https://issues.gradle.org/browse/GRADLE-3256) for details. +The Gradle daemon eliminates startup overhead. It's enabled by default, but sometimes you may need to disable it. For example, if building against [JDK 9](https://jdk9.java.net/download/), you may encounter an `Unrecognized VM option` error which halts the build. To avoid that error, add `org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m` to the `gradle.properties` file in your _gradle user home_ directory. See also [GRADLE-3256](https://issues.gradle.org/browse/GRADLE-3256) for details. -To install all Spring Framework jars into your local Maven cache (note that "-x" skips Javadoc generation): -``` +### Install in local Maven repository + +To install all Spring Framework jars in your local Maven repository (note that `-x javadoc` skips Javadoc generation) use: + +```shell ./gradlew install -x javadoc ```