Merge pull request #3297 from Quantas/master

* pr/3297:
  Prevent restart when META-INF/maven/** changes
pull/3308/merge
Stephane Nicoll 10 years ago
commit dc7d17091a

@ -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;

@ -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);
}

@ -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]
----

Loading…
Cancel
Save