【问题标题】:Disabling dynamicReload/developmentModeWatch in Grails4/5 for DEV Environemnt在 Grails 4/5 中为 DEV 环境禁用动态 Reload/developmentModeWatch
【发布时间】:2022-01-14 22:26:54
【问题描述】:

我想禁用 Grails4/5 中的动态重新加载机制。

在我的情况下,它不够有效,所以我宁愿避免所有 "File {} changed, recompiling..." 消息

我非常了解this 之类的建议 将grails.agent.enabled = false 放入build.gradle

但这似乎不起作用。

我在source code找到了这个if条件:

        if(environment.isReloadEnabled()) {
            log.debug("Reloading status: {}", environment.isReloadEnabled())
            enableDevelopmentModeWatch(environment, applicationContext)
            environment.isDevtoolsRestart()
        }

获取值here:

    public boolean isReloadEnabled() {
        final boolean reloadOverride = Boolean.getBoolean(RELOAD_ENABLED);
        getReloadLocation();
        final boolean reloadLocationSpecified = hasLocation(reloadLocation);
        return this == DEVELOPMENT && reloadLocationSpecified ||
                reloadOverride && reloadLocationSpecified;
    }

但这几乎总是评估为true

reloadLocation 总是 something 其中 reloadOverride 总是 null

【问题讨论】:

  • 您指出的grails.agent.reload 问题是解决Grails 3,当时默认情况下在项目中配置了Spring Loaded。这里的问题是解决 Grails 4/5,而不是这种情况的版本。

标签: grails


【解决方案1】:

您可以从依赖项中删除 org.springframework.boot:spring-boot-devtools

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-12-07
  • 2019-01-13
  • 2023-03-09
  • 2022-11-04
  • 1970-01-01
  • 2011-08-18
  • 2018-04-19
  • 2013-11-13
相关资源
最近更新 更多