diff --git a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java index 408e78943b..4fd92a6108 100644 --- a/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java +++ b/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/DevToolsProperties.java @@ -29,7 +29,7 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty; @ConfigurationProperties(prefix = "spring.devtools") public class DevToolsProperties { - private static final String DEFAULT_RESTART_EXCLUDES = "META-INF/resources/**,resources/**,static/**,public/**,templates/**"; + private static final String DEFAULT_RESTART_EXCLUDES = "META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**"; private static final long DEFAULT_RESTART_POLL_INTERVAL = 1000; diff --git a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/PatternClassPathRestartStrategyTests.java b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/PatternClassPathRestartStrategyTests.java index 57dc685402..2749937de6 100644 --- a/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/PatternClassPathRestartStrategyTests.java +++ b/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/PatternClassPathRestartStrategyTests.java @@ -19,8 +19,7 @@ package org.springframework.boot.devtools.classpath; import java.io.File; import org.junit.Test; -import org.springframework.boot.devtools.classpath.ClassPathRestartStrategy; -import org.springframework.boot.devtools.classpath.PatternClassPathRestartStrategy; + import org.springframework.boot.devtools.filewatch.ChangedFile; import org.springframework.boot.devtools.filewatch.ChangedFile.Type; @@ -31,6 +30,7 @@ import static org.junit.Assert.assertThat; * Tests for {@link PatternClassPathRestartStrategy}. * * @author Phillip Webb + * @author Andrew Landsverk */ public class PatternClassPathRestartStrategyTests { @@ -66,6 +66,16 @@ public class PatternClassPathRestartStrategyTests { assertRestartRequired(strategy, "src/folder/file.txt", true); } + @Test + public void pomChange() throws Exception { + ClassPathRestartStrategy strategy = createStrategy("META-INF/maven/**"); + assertRestartRequired(strategy, "pom.xml", true); + assertRestartRequired(strategy, + "META-INF/maven/org.springframework.boot/spring-boot-devtools/pom.xml", false); + assertRestartRequired(strategy, + "META-INF/maven/org.springframework.boot/spring-boot-devtools/pom.properties", false); + } + private ClassPathRestartStrategy createStrategy(String pattern) { return new PatternClassPathRestartStrategy(pattern); } diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 362bae95f1..c770c242bc 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -828,10 +828,10 @@ commercially supported. ==== Excluding resources Certain resources don't necessarily need to trigger a restart when they are changed. For example, Thymeleaf templates can just be edited in-place. By default changing resources -in `/META-INF/resources` ,`/resources` ,`/static` ,`/public` or `/templates` will not -trigger a restart. If you want to customize these exclusions you can use the -`spring.devtools.restart.exclude` property. For example, to exclude only `/static` and -`/public` you would set the following: +in `/META-INF/maven`, ``/META-INF/resources` ,`/resources` ,`/static` ,`/public` or +`/templates` will not trigger a restart. If you want to customize these exclusions you +can use the `spring.devtools.restart.exclude` property. For example, to exclude only +`/static` and `/public` you would set the following: [indent=0] ----