- 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.
推薦閱讀
- 隨身查:從原始數(shù)據(jù)到完美Excel圖表
- Excel函數(shù)與公式標(biāo)準(zhǔn)教程(實(shí)戰(zhàn)微課版)
- The Art of CRM
- Office 2013輕松辦公:Word/Excel/PowerPoint三合一超級(jí)應(yīng)用大全(實(shí)戰(zhàn)案例版)
- Word+Excel+PPT高效辦公從入門(mén)到精通
- 非常Easy:Excel財(cái)務(wù)高效管理
- Excel 2013從新手到高手(超值版)
- PPT制作事半功倍
- Minecraft創(chuàng)客制作:用樂(lè)高、3D打印、Arduino等創(chuàng)建Minecraft真實(shí)世界
- Word/Excel/PowerPoint 2013三合一辦公應(yīng)用
- 做好PPT就靠這幾招:圖解力 吸引力 說(shuō)服力(全彩圖解版)
- Office2010高級(jí)應(yīng)用教程
- WOW!電腦辦公可以這樣簡(jiǎn)單
- PowerPoint 2016從入門(mén)到精通
- PowerPoint 2010從入門(mén)到精通