spring-boot - Spring Boot bootRun 持续构建

标签 spring-boot gradle

通过运行 gradle build --continuous 应该可以持续构建 Spring Boot 应用程序(即热重载)和 gradle bootRun按顺序。

我正在尝试修改 gradle 构建文件中的 bootRun 任务,以便它以连续模式调用构建任务,但我似乎无法为其添加参数。

bootRun.dependsOn build

我怎样才能让这个构建持续运行?

最佳答案

This question and the corresponding answers很有趣。

Short answer : 你不能拥有 bootRuncontinuous 一起运行的任务选项(如果您的应用程序无限期地保持事件状态)

但是有a hack斯蒂芬·克雷恩 :

To get it to live reload you need to have 2 terminals open.

  1. gradle build --continuous

    • build --continuous will keep satisfying the initial build request until stopped
    • gradle build --continuous --quiet & 2>1 >/dev/null runs in the background, but you would miss the important build warnings/errors. gradle --stop to stop watching.
  2. gradle bootRun

    • bootrun starts with spring-boot-devtools on classpath, which will detect changes and restart application.


我想这就是你要找的。

关于spring-boot - Spring Boot bootRun 持续构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52092504/

相关文章:

spring - grails 3 spring安全启动启动程序登录页面自定义

gradle - Gradle中的多项目构建顺序

gradle - 为一项任务禁用远程 Gradle 缓存

java - 使用 gradle 修改 Android 库的包

spring-boot - Swagger ui 使用 ip 和端口而不是域名

java - 如何从 CURL 访问静态端点

java - Spring Boot中的服务限制功能

java - 在 spring boot JPA 中,如何正确地将实体表示具有外键关联的对象发布到不同的实体?

java - Gradle:如何从 jar 中排除特定的包?

android - 找不到support-core-ui.aar Ionic 3构建错误