Oct 21, 2019 in Gradle


How Long Should A Build Take? When Running `./gradlew Build` For The First Time, It Is Likely That The Gradle Wrapper Script Will Need To Download Gradle For You. Gradle Distributions Run Around 30mb, So This Step Will Be Connection-speed Dependent?

1 Answer

Oct 21, 2019

You will also need to download all of Spring’s compile- and test-time dependencies. This currently runs around 120MB. Keep in mind here that almost all of these dependencies are optional at runtime for applications that use Spring. It’s only when building from source that you actually need them all!

Once you’ve bootstrapped a Gradle distribution and downloaded dependencies, you won’t need to do it again; they are cached in your $HOME/.gradle directory. A complete ./gradle clean build at this point will take between 5 and 15 minutes depending on your clock and disk speed. A solid-state drive makes a huge difference here!

As is also mentioned below in the ‘tips’ section, you’ll want to break yourself of any habits executing the clean task during normal development iterations. Gradle has excellent incremental build support, meaning that once you’ve built Javadoc, compiled, run test, etc, Gradle won’t execute these tasks again unless the inputs for those tasks (e.g. .java files) have changed. As a general rule, just run ./gradle build or ./gradle test (without clean) to keep things snappy.

Also, consider running with the -a flag to avoid evaluating other subprojects you depend on. For example, if you’re iterating on changes in spring-web MVC, cd into the spring-web MVC directory and run ../gradlew -a build to tell Gradle to evaluate and build only that subproject.

Click here to read more about Gradle
Click here to read more about Insurance

Related questions

Nov 11, 2019 in DevOps
Dec 30, 2019 in TOGAF
Jan 31 in Gradle