![Spring 5.0 Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/699/36700699/b_36700699.jpg)
上QQ阅读APP看书,第一时间看更新
How to do it...
After installing the Gradle STS extension, perform the following steps to install the Spring Gradle project:
- After installing, you are ready to create a Gradle project for Spring development. Go to the New project wizard (Ctrl-N) of STS Eclipse and create a Gradle project.
- On the Gradle Project wizard, assign a name for your project and choose Java Quickstart for the Sample project option. Click Finish and it will take a while to create, build, clean, and install your Gradle STS project.
- Delete unnecessary project files. Right-click on the project and click on Gradle (STS) | Refresh all.
- Open the build.gradle and overwrite the existing configuration with this:
apply plugin: 'eclipse'
apply plugin: "war"
sourceCompatibility = 1.8
version = '1.0'
war {
baseName = 'ch02-gradle'
version = '1.0'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
- Right-click on the project and click Gradle (STS) | Tasks Quick Launcher to run the Gradle Task Launcher. Using the launcher, clean and build the project for the first time:
![](https://epubservercos.yuewen.com/0AC9E4/19470403601617006/epubprivate/OEBPS/Images/01f90efe-f279-4b76-a4d5-1ab6ed2a431a.png?sign=1739013010-S7aoU6VDM52nC4RL1J7wYnixZ9976QIO-0-d9193290520c8bea717c5bb50b2a38ff)
- Finally, at this point, you have created your Spring Gradle project which will look like this:
![](https://epubservercos.yuewen.com/0AC9E4/19470403601617006/epubprivate/OEBPS/Images/0ccf8af1-313b-4c29-b945-63df05b2c89d.png?sign=1739013010-Xcp1femJpVvYd1kMsma7ThtTsid7LHBY-0-a27716215ec37644637606d02ccaa183)