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") @ConfigurationProperties(prefix = "spring.devtools")
public class DevToolsProperties { 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; private static final long DEFAULT_RESTART_POLL_INTERVAL = 1000;

@ -19,8 +19,7 @@ package org.springframework.boot.devtools.classpath;
import java.io.File; import java.io.File;
import org.junit.Test; 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;
import org.springframework.boot.devtools.filewatch.ChangedFile.Type; import org.springframework.boot.devtools.filewatch.ChangedFile.Type;
@ -31,6 +30,7 @@ import static org.junit.Assert.assertThat;
* Tests for {@link PatternClassPathRestartStrategy}. * Tests for {@link PatternClassPathRestartStrategy}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Andrew Landsverk
*/ */
public class PatternClassPathRestartStrategyTests { public class PatternClassPathRestartStrategyTests {
@ -66,6 +66,16 @@ public class PatternClassPathRestartStrategyTests {
assertRestartRequired(strategy, "src/folder/file.txt", true); 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) { private ClassPathRestartStrategy createStrategy(String pattern) {
return new PatternClassPathRestartStrategy(pattern); return new PatternClassPathRestartStrategy(pattern);
} }

@ -828,10 +828,10 @@ commercially supported.
==== Excluding resources ==== Excluding resources
Certain resources don't necessarily need to trigger a restart when they are changed. For 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 example, Thymeleaf templates can just be edited in-place. By default changing resources
in `/META-INF/resources` ,`/resources` ,`/static` ,`/public` or `/templates` will not in `/META-INF/maven`, ``/META-INF/resources` ,`/resources` ,`/static` ,`/public` or
trigger a restart. If you want to customize these exclusions you can use the `/templates` will not trigger a restart. If you want to customize these exclusions you
`spring.devtools.restart.exclude` property. For example, to exclude only `/static` and can use the `spring.devtools.restart.exclude` property. For example, to exclude only
`/public` you would set the following: `/static` and `/public` you would set the following:
[indent=0] [indent=0]
---- ----

Loading…
Cancel
Save