spring boot gradle tomcat 部署

场景:在使用springboot集成gradle的时候,需要部署到tomcat。就记录了下。按照步骤,可直接使用

使用Gradle:

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")
    providedCompile("org.springframework.boot:spring-boot-starter-tomcat")//此处使用providedCompile,则生成的jar包可放入tomcat内运行
//    compile("org.springframework.boot:spring-boot-starter-tomcat")//我们再开发的时候,使用这个,打包为war时使用providedCompile
    testCompile group: 'junit', name: 'junit', version: '4.11'
}
重点为使用providedCompile



apply plugin: 'war'

如图:

56c1e401df08311fae1774a16efb2da7.png
  • 发表于 2017-11-08 17:02
  • 阅读 ( 1763 )
  • 分类:Java

0 条评论

请先 登录 后评论
不写代码的码农
威猛的小站长

124 篇文章

作家榜 »

  1. 威猛的小站长 124 文章
  2. Jonny 65 文章
  3. 江南烟雨 36 文章
  4. - Nightmare 33 文章
  5. doublechina 31 文章
  6. HJ社区-肖峰 29 文章
  7. 伪摄影 22 文章
  8. Alan 14 文章