- Mastering Spring Boot 2.0
- Dinesh Rajput
- 178字
- 2021-06-25 21:29:12
Setting up Spring Boot with Gradle
We have seen that Java 8 is the minimum requirement for Spring Boot 2.0, both with Maven and Gradle. However, if you want to use Gradle, then first install Gradle 4 or above in your machine from www.gradle.org/.
Now, see the following Gradle Spring Boot dependencies file with org.springframework.boot groupId. Here's what the build.gradle file should look like:
buildscript { repositories { jcenter() maven { url 'http://repo.spring.io/snapshot' } maven { url 'http://repo.spring.io/milestone' } } dependencies { classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.0.0.M7' } } apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' jar { baseName = 'HelloWorld' version = '0.0.1-SNAPSHOT' } repositories { jcenter() maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } } dependencies { compile("org.springframework.boot:spring-boot-starter-web") testCompile("org.springframework.boot:spring-boot-starter-test") }
The preceding Gradle file has minimum requirements for the Spring Boot application. You could use either Maven or Gradle since the process is the same. Spring Boot creates an application using the same process.
Let's create your first Spring Boot application and see how to set up the project's structure using Spring Boot Initializr.
推薦閱讀
- Word排版技術大全(第2版)
- Excel VBA語法辭典
- 和秋葉一起學:秒懂WPS演示文稿
- Excel 2013從新手到高手(超值版)
- Word/Excel/PPT 2016商務辦公從新手到高手
- Yammer Starter
- Excel數據可視化:從圖表到數據大屏
- Word/Excel/PPT 2016高效辦公實戰從入門到精通
- 快速編碼:高效使用MicrosoftVisualStudio
- Excel人力資源管理必備的200個文件
- Excel/PPT 2013辦公應用從入門到精通
- BIOS與注冊表完全自學手冊
- 新編Word/Excel/PPT 2003從入門到精通
- Raspberry Pi Computer Vision Programming
- 新手學五筆打字+Office 2013電腦辦公從入門到精通