【发布时间】: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