gpt4 book ai didi

spring-boot - Spring Boot bootRun 持续构建

转载 作者:行者123 更新时间:2023-12-03 14:38:18 24 4
gpt4 key购买 nike

通过运行 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com