mavenspring-boot-devtools

Breakpoints and maven options are ignored when using spring devtools


I'm trying to use spring devtools for my project. When I add devtools dependency breakpoints stopped working and maven options are ignored. I'm using Netbeans. I added dependency into pom.xml

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-devtools</artifactId>
</dependency>

And this is the netbeans action for debug:

Executed goal: spring-boot:run
Profile: dev
Properties:
 jpda.listen=maven
 Env.MAVEN_OPTS=-Dflyway.enabled=false

Breakpoints and maven options (MAVEN_OPTS) are working fine without devtools dependency. Adding the devtools dependency causes "-Dflyway.enabled=false" option and breakpoints being ignored. The maven command with all arguments generated by Netbeans is the same, I can see it in the log output. Is there anything else I have to set for devtools?


Solution

  • I found the answer, the properties in action must be written this way (spring boot 2.0.0):

    spring-boot.run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dspring.flyway.enabled=false
    jpda.listen=true
    

    For spring boot version < 2.0.0 it is:

    run.jvmArguments=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -Dflyway.enabled=false
    jpda.listen=true