Java 运行 springboot 应用程序的“gradle bootRun”和“gradle run”有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37338407/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 19:12:57  来源:igfitidea点击:

What is the difference between "gradle bootRun" and "gradle run" to run a springboot application?

javaspringgradlespring-boot

提问by Sanchit

To run a Spring Boot application, there are two gradle tasks:

要运行 Spring Boot 应用程序,有两个 gradle 任务:

  1. gradle bootRun
  2. gradle run
  1. gradle bootRun
  2. gradle run

Both tasks can be used to run the Spring Boot application, what are the main differences between these tasks?

这两个任务都可以用来运行 Spring Boot 应用程序,这些任务之间的主要区别是什么?

回答by sQer

  1. gradle bootRun- standard gradle'run' task with additional Spring Boot features. e.g. you can type: bootRun {addResources = false}check github
  2. gradle runstandard gradle 'run' task
  1. gradle bootRun- 带有附加 Spring Boot 功能的标准 gradle'run' 任务。例如,您可以输入:bootRun {addResources = false}检查 github
  2. gradle run标准gradle“运行”任务