我一直在使用Rails,PHP和Node.js,并曾经在代码更改后自动重新加载。
现在,我正在尝试使用Java并执行以下两个命令:
gradle build --continuous
gradle bootRun
但是我只有在重新启动gradle bootRun之后才能看到更改
每次更改代码后,都可以重建并重新运行spring吗?
最佳答案
Spring开发人员工具将为您解决这个问题。只需在Gradle构建文件中添加以下依赖项即可。
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
}
有关更多详细信息,请参考:https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html
关于java - Java Spring工作流程,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53781908/