2

I'm trying to convert a project from maven to gradle, but I'm having trouble getting hot reloading to work the same way. I can't show the actual project so I've created two identical very simple projects. One with maven one with gradle. These projects contain two modules:

project
|____api
|____lib

The /api module contains a spring-boot app which depends on code from the /lib module

In the maven project I can change code in either of these modules and recompile either with my IDE (intellij) or with the maven cli and spring-boot-devtools will hot reload the application. However in the gradle version it only successfully hot reloads code that has changed in the /api module.

From what I gathered this seems like a classpath issue. If you run gradle or maven in debug mode it prints out the classpath it passes when it starts the application. Maven includes <project_dir>/lib/target/classes/kotlin/main. However gradle only includes <project_dir>/lib/build/libs/lib.jar

I'm very new to gradle to I might have some of the build configuration messed up. Here are the two project repo's:

Maven: https://github.com/Perry-Olsson/mvn-hot-reload

Gradle: https://github.com/Perry-Olsson/gradle-hot-reload

  • I still couldn't make it work. The best lead so far is this: https://github.com/spring-projects/spring-boot/issues/34237 – Thiago Chaves Apr 18 '23 at 13:48

0 Answers0