0

This one has me scratching my head.

I have a Spring Boot 1.5.12 web app (with maven project) that has a dependency that is another Spring Boot 1.5.12 JAR file (as maven project). I want the web app to auto restart whenever the JAR file is rebuilt. However, even though I appear to have everything configured properly, the web app is not restarting properly.

I am using the command-line mvn command.

I am specifying the correct name for the JAR file in the spring-devtools.properties file in the web app:

restart.include.icamp-shared=icamp-shared-1.0-SNAPSHOT.jar

When I start up the web app, I see the following message in the log:

23:06:18.586 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : [xstream-1.4.9.jar, icamp-shared-1.0-SNAPSHOT.jar, xstream-hibernate-1.4.9.jar, json-io-4.9.4.jar, xstream-1.4.9.jar, xstream-hibernate-1.4.9.jar, json-io-4.9.4.jar, xstream-1.4.9.jar, xstream-hibernate-1.4.9.jar, json-io-4.9.4.jar]
23:06:18.590 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
23:06:18.594 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/gerald/dev/ahs/redstone/git/iib/target/classes/, file:/Users/gerald/.m2/repository/com/cedarsoftware/json-io/4.9.4/json-io-4.9.4.jar, file:/Users/gerald/.m2/repository/com/thoughtworks/xstream/xstream-hibernate/1.4.9/xstream-hibernate-1.4.9.jar, file:/Users/gerald/.m2/repository/com/icsynergy/icamp-shared/1.0-SNAPSHOT/icamp-shared-1.0-SNAPSHOT.jar, file:/Users/gerald/.m2/repository/com/thoughtworks/xstream/xstream/1.4.9/xstream-1.4.9.jar`

The file URL for the dependent JAR is correct- it is located in my Maven repository.

I start up the application, and recompile the dependent jar file- the change is not detected. When I change a class within the project and rebuild the project, the change is properly detected. This is all from the command-line using the mvn command.

BTW, it also doesn't detect any changes to any of the other JARs that were listed in the properties file.

I have the following in my POM:

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

Here is my complete spring-devtools.properties file:

restart.include.jsonio=json-io-4.9.4.jar
restart.include.xstream=xstream-1.4.9.jar
restart.include.xstream-hibernate=xstream-hibernate-1.4.9.jar
restart.include.icamp-shared=icamp-shared-1.0-SNAPSHOT.jar

Any ideas?

gooboo
  • 141
  • 1
  • 8

1 Answers1

0

If you're using IntelliJ IDEA you'll be needing to do the followings:

  1. In your intellij IDEA go to: file->settings->build,execution,deployment. Then ->compiler->build project automatically and make sure it's ticked.
  2. In your intellij IDEA: SHIFT+Ctrl+A and type Registry compiler.automake.allow.when.app.running and make sure it's ticked. Hope this helps.
Plabon Dutta
  • 6,819
  • 3
  • 29
  • 33