Prevent restart when META-INF/maven/** changes

These files are modified by Eclipse for some reason when you change files
like Thymeleaf HTML files. `META-INF/maven/**` has been added to the
default exclusion.

Closes gh-3295
Closes gh-3297
This commit is contained in:
Andrew Landsverk
2015-06-20 16:40:13 -05:00
committed by Stephane Nicoll
parent 92a6e3188b
commit 487ab1a60a
3 changed files with 17 additions and 7 deletions

View File

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