gradle 中指定 spring boot 的 thymeleaf 的版本

 实际上下面这两行

ext['thymeleaf.version'] = '3.0.2.RELEASE'
ext['thymeleaf-layout-dialect.version'] = '2.1.1'

build.gradle 配置如下:

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')
}

 

转载于:https://my.oschina.net/u/1383742/blog/1559503

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值