
gradle provided和compile的区别
2个回答
展开全部
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'

2024-10-28 广告
作为优菁科技(上海)有限公司的一员,Altair HyperWorks是我们重点代理的CAE软件套件。该软件以其全面的仿真能力、丰富的建模工具和高效的优化设计功能著称,广泛应用于汽车、航空航天、能源及电子等行业。HyperWorks通过集成...
点击进入详情页
本回答由名片提供
2016-03-15 · 知道合伙人软件行家
关注

展开全部
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‘
如果你的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‘
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询