Skip to content

Remove skipping of spring-boot-* projects when determining what is eligible for DevTools restart #23158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wilkinsona opened this issue Sep 1, 2020 · 3 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@wilkinsona
Copy link
Member

Prompted by #3315 (comment), I think we should review DevTools' restart excludes and make them more apparent at runtime.

The current defaults are a little odd as they're tailored towards Spring Boot's development, ignoring …/target/classes in 2.2.x which is built with Maven and …/build in 2.3.x which is built with Gradle. The behaviour that users see shouldn't be affected by the build system used to build Boot itself so it feels like we should either remove these default excludes or alter them so that they don't only apply to a particular build system.

When excludes have been applied – particularly when they leave you with no changeable URLs, and, therefore, no restart – it's not obvious that's what has happened. We should look at improving the logging somehow to help users to identify why changes to their application are having no effect.

@wilkinsona wilkinsona added for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Sep 1, 2020
@philwebb
Copy link
Member

philwebb commented Sep 9, 2020

See #4040

@philwebb philwebb added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Sep 16, 2020
@philwebb philwebb added this to the 2.4.x milestone Sep 16, 2020
@wilkinsona wilkinsona changed the title Review DevTools' restart excludes and make them more apparent at runtime Remove skipping of spring-boot-* projects when determining what is eligible for DevTools restart Sep 16, 2020
@wilkinsona
Copy link
Member Author

I'm not sure that I understand DefaultSourceDirectoryUrlFilterTests#skippedProjects as it still passes when SKIPPED_PROJECTS has been removed from DefaultSourceDirectoryUrlFilterTests. These are the changes that I made:

diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/DefaultSourceDirectoryUrlFilter.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/DefaultSourceDirectoryUrlFilter.java
index b2fb5a550d..0d16d82221 100644
--- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/DefaultSourceDirectoryUrlFilter.java
+++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/server/DefaultSourceDirectoryUrlFilter.java
@@ -17,9 +17,6 @@
 package org.springframework.boot.devtools.restart.server;
 
 import java.net.URL;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -40,9 +37,6 @@ public class DefaultSourceDirectoryUrlFilter implements SourceDirectoryUrlFilter
 
        private static final Pattern VERSION_PATTERN = Pattern.compile("^-\\d+(?:\\.\\d+)*(?:[.-].+)?$");
 
-       private static final Set<String> SKIPPED_PROJECTS = new HashSet<>(Arrays.asList("spring-boot",
-                       "spring-boot-devtools", "spring-boot-autoconfigure", "spring-boot-actuator", "spring-boot-starter"));
-
        @Override
        public boolean isMatch(String sourceDirectory, URL url) {
                String jarName = getJarName(url);
@@ -73,7 +67,7 @@ public class DefaultSourceDirectoryUrlFilter implements SourceDirectoryUrlFilter
        }
 
        private boolean isDirectoryMatch(String directory, String jarName) {
-               if (!jarName.startsWith(directory) || SKIPPED_PROJECTS.contains(directory)) {
+               if (!jarName.startsWith(directory)) {
                        return false;
                }
                String version = jarName.substring(directory.length());

Any ideas, @philwebb?

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Sep 25, 2020
@philwebb
Copy link
Member

Sorry @wilkinsona, I've been looking at the commit logs and trying to remember but I have no idea.

@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label Sep 25, 2020
@wilkinsona wilkinsona self-assigned this Oct 27, 2020
@wilkinsona wilkinsona modified the milestones: 2.4.x, 2.4.0-RC1 Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants