Grails 4热插拔/重新编译

时间:2020-04-22 09:17:22

标签: spring spring-boot grails

我正在使用: 智能 grails版本:4.0.3 gorm.version:7.0.4。发布

我得到: Testcontroller.groovy changed, recompiling...

但是我的代码没有被热部署。 使用Grails 3,一切正常。

我该怎么做才能使Grails 4和Spring Boot 2中的控制器得到热部署?

2 个答案:

答案 0 :(得分:3)

您可以使用弹簧加载(项目已经闲置了多年,但仍然可以运行)或使用JRebel进行“热”重新加载。

要启用:

build.gradle

$get_monthly_payments_lastmonth=AppPayment::where('payment_annum','=','monthly')
        ->whereDate('created_at', '>', Carbon::now()->subMonth())
        ->get();

请参阅:https://github.com/grails/grails-core/pull/11441

答案 1 :(得分:1)

解决了在build.gradle中忘记的问题:

    developmentOnly("org.springframework.boot:spring-boot-devtools")

与旧版Spring Boot相比,它的运行速度非常慢,但效果确实如此。