Spring Boot是為了簡化Spring應(yīng)用的創(chuàng)建、運(yùn)行檐什、調(diào)試、部署等而出現(xiàn)的弱卡,使用它可以做到專注于Spring應(yīng)用的開發(fā)乃正,而無需過多關(guān)注XML的配置。
簡單來說婶博,它提供了一堆依賴打包瓮具,并已經(jīng)按照使用習(xí)慣解決了依賴問題---習(xí)慣大于約定。
Spring Boot默認(rèn)使用tomcat作為服務(wù)器凡人,使用logback提供日志記錄名党。
本項目使用Gradle來構(gòu)建Spring Boot
buildscript {
? ? ? ? ?repositories {
? ? ? ? mavenCentral()
? ? ? ? ? ? }
? ? ? ? ?dependencies {
? ? ? ? ? ? ? ?classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.1.RELEASE")
? ? ? ? ? ?}
? ?}
//支持插件
applyplugin:'java'
applyplugin:'idea'
applyplugin:'org.springframework.boot'
applyplugin:'war'
war {
baseName='shihuilaw'
version='1.0.0'
}
repositories {
? ? ? ? ? ?maven { url"https://repo.spring.io/libs-release"}
//maven倉庫地址
? ? ? ? ? maven { url"http://maven.aliyun.com/nexus/content/groups/public/"}
? ? ? ? ?mavenLocal()
? ? ? ? ?mavenCentral()
? ? ? ? ? ?maven { url"http://repo.spring.io/libs-snapshot"}
? ?}
sourceCompatibility =1.8//java版本
targetCompatibility =1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
testCompile('org.springframework.boot:spring-boot-starter-test')
compile fileTree(dir:'libs',include:['*.jar'])//手動引入jar包
}