Spring-boot-devtools does not reload dependent modules in maven multi-module project

Before starting, I would like to say that I already tried the solution offered in spring-boot-devtools reloading changes in the maven maven module , which did not work for me.

Problem:

I have a multi-module Spring boot project of this kind:

enter image description here

The launcher has a Maven dependency on the GUI module. I am running the Spring Boot application from the main method in startup .

When I launch the application and modify any HTML file in the GUI module, the spring-boot-devtools does not perform a live reload of these changes for my application. Even manual restart of the launcher is not supported. I need to compile the GUI manually and then run launcher again.

What I tried:

  • I tried to determine the spring-boot-devtools first in the parent pom.xml , then only in the GUI module, and then in both at the same time.
  • I tried adding spring.devtools.restart.additional-paths=../gui to my application.properties file, as suggested in spring-boot-devtools reloading changes to several maven modules . This does cause a reboot (according to the log), but these changes just don't apply to the GUI dependency jar file. In addition, before I even made this project in a multi-module, I didn’t need to reload just because of HTML files (nothing compiles), and I could immediately see the changes.

I use the Netbeans GUI if that helps. I also tried to run the project from the command line without success. Maven packaging on all modules is installed on the jar .

+7
spring spring-boot spring-boot-devtools
source share
2 answers

I have no idea how this happened, but after one review, he began to work without me, without changing anything. It does not even require the presence of the spring.devtools.restart.additional-path property.

Perhaps a problem with the Netbeans IDE? On the other hand, this did not work from the command line either. If someone explains this, he will still be grateful, as this may interfere with this problem in the future.

-3
source share

The fact that this works when setting up absolute paths in devtools tells me that this is a problem with the working directory.

So this means that:

  • configured paths should relate to where you run the CLI
  • you need to configure the same location as the working directory in the startup configuration of your IDE (any configuration that the IDE uses to run the application should be able to do this)

In your case: everything should be relative to your launcher; it should also be your working directory in your IDE.

+5
source share

All Articles