【问题标题】:Grails 3.3.8 does not reload the changes made to the projectGrails 3.3.8 不会重新加载对项目所做的更改
【发布时间】:2018-10-07 14:33:10
【问题描述】:

我有一个使用 grails 3.3.8 的项目,问题是一旦我编辑控制器或 gsp 文件,更改不会反映在 Web 浏览器中,即使在检测到更改时出现以下消息:

Controller.groovy change, compiling...

我已尝试通过以下方式启动应用程序:

grails -reloading run-app.

还有:

// File: build.gradle
import grails.util.Environment
...
bootRun {

    final Boolean reloadEnabled =
            Boolean.valueOf(
                    System.properties[Environment.RELOAD_ENABLED])

    if (reloadEnabled) {
        systemProperty Environment.RELOAD_ENABLED, reloadEnabled
    }

}
...

grails -Dgrails.env=custom -Dgrails.reload.enabled=true run-app

【问题讨论】:

  • 我无法重新创建它。对我来说,重新加载似乎可以正常工作。
  • 你有 JDK 1.7 吗?
  • "你有 JDK 1.7 吗?" - 是的,我有 JDK 1.7。

标签: grails


【解决方案1】:

根据此链接https://intellij-support.jetbrains.com/hc/en-us/community/posts/207602705-Grails-3-not-automatically-hot-swapping-changed-code-after-upgrading-to-2016-1-3,当环境设置为开发时,似乎只有在 grails 3.3.x 中才会发生类的热重载。 但是,我无法为自己确认这一点。我注意到您正在提供“自定义”作为您的环境。也许尝试将其更改为开发环境,看看是否有帮助。

还只是想确认您不只是看到Grails auto recompile never completes (Grails 3.3.6) 中列出的行为

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 1970-01-01
    • 2020-08-08
    • 2013-10-27
    • 2020-04-01
    • 2022-01-17
    • 1970-01-01
    相关资源
    最近更新 更多