實際上下面這兩行html
ext['thymeleaf.version'] = '3.0.2.RELEASE'
ext['thymeleaf-layout-dialect.version'] = '2.1.1'java
build.gradle 配置以下:mysql
configurations { providedRuntime } /** 配置這兩個屬性使用新版的 thymeleaf 而不是默認的 2.1 官方說明(但未說明Gradle如何配置):http://docs.spring.io/spring-boot/docs/1.5.4.RELEASE/reference/htmlsingle/#howto-use-thymeleaf-3 Gradle 配置方式 參考:https://github.com/spring-projects/spring-boot/issues/4393 */ ext['thymeleaf.version'] = '3.0.2.RELEASE' ext['thymeleaf-layout-dialect.version'] = '2.1.1' ext['environment'] = System.getProperty("env", "dev")// 運行和打包的環境選擇, 默認是開發環境 ,獲取 gradle 參數中 -Dprofile 的值: gradle -Denv=production clean build dependencies { compile 'org.springframework.boot:spring-boot-devtools' compile('org.springframework.boot:spring-boot-starter-aop') compile('org.springframework.boot:spring-boot-starter-cache') //compile('org.springframework.boot:spring-boot-starter-jdbc') compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-starter-jersey') compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.0') //compile('org.springframework.boot:spring-boot-starter-security') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-web-services') //compile('org.springframework.boot:spring-boot-starter-tomcat') compile('org.springframework.boot:spring-boot-starter-undertow') compile('mysql:mysql-connector-java') compile('com.alibaba:druid:1.0.25') compile('org.apache.commons:commons-lang3:3.4') compile('org.apache.poi:poi:3.9') compile('org.apache.poi:poi-ooxml:3.9') compile('org.bitbucket.b_c:jose4j:0.5.1') compile('org.apache.httpcomponents:httpclient:4.5.2') compile('org.apache.httpcomponents:httpmime') compile('com.belerweb:pinyin4j:2.5.0') compile('org.apache.axis2:axis2-kernel:1.7.4') compile('org.apache.axis2:axis2-adb:1.2') compile('net.sf.json-lib:json-lib:2.4:jdk15') compile('com.google.guava:guava:18.0') compile('com.thoughtworks.xstream:xstream:1.4.2') //compile('javax.persistence:persistence-api:1.0.2') //spring-shiro setting start compile('org.apache.shiro:shiro-core:1.2.2') compile('org.apache.shiro:shiro-spring:1.2.2') compile('org.apache.shiro:shiro-ehcache:1.2.2') //spring-shiro setting end compile fileTree(dir:'libs',include:'*.jar') //compile('org.springframework:springloaded:1.2.7.RELEASE') //providedRuntime('org.springframework.boot:spring-boot-starter-tomcat') //providedRuntime('org.springframework.boot:spring-boot-starter-undertow') //打war包設置 runtime('org.springframework.boot:spring-boot-starter-undertow') //打jar包須要設置爲runtime testCompile('org.springframework.boot:spring-boot-starter-test') }