用户登录
用户注册

分享至

gradle compile

  • 作者: 小刀29860943
  • 来源: 51数据库
  • 2020-09-28
gradle provided和compile的区别在于使用providedCompile的前提是apply plugin: 'war'
1、Gradle compile:
假如你的jar包存在代码依赖性,在编译、运行时候需要依赖代码,那就用compile
例如 :
compile 'org.springframework.boot:spring'

2、Gradle providedCompile:
假如你的jar包存在代码依赖性,但是在编译的时候才用得上,而运行时不需要,就用providedCompile
例如:
providedCompile 'org.springframework.boot:spring'



  gradle compile:
如果你的jar包/依赖代码 在编译的时候需要依赖,在运行的时候也需要,那么就用compile
例如 :
compile ‘org.springframework.boot:spring-boot-starter-websocket:1.1.6.release‘

gradle providedcompile:
如果你的jar包/依赖代码 仅在编译的时候需要,但是在运行时不需要依赖,就用providedcompile
例如:
providedcompile ‘org.springframework.boot:spring-boot-starter-tomcat:1.1.6.release‘
软件
前端设计
程序设计
Java相关