|
|
@ -121,7 +121,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isWebApplication(Environment environment) {
|
|
|
|
private boolean isWebApplication(Environment environment) {
|
|
|
|
for (String candidate : WEB_ENVIRONMENT_CLASSES) {
|
|
|
|
for (String candidate : WEB_ENVIRONMENT_CLASSES) {
|
|
|
|
Class<?> environmentClass = ClassUtils.resolveClassName(candidate,
|
|
|
|
Class<?> environmentClass = resolveClassName(candidate,
|
|
|
|
environment.getClass().getClassLoader());
|
|
|
|
environment.getClass().getClassLoader());
|
|
|
|
if (environmentClass != null && environmentClass.isInstance(environment)) {
|
|
|
|
if (environmentClass != null && environmentClass.isInstance(environment)) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -130,4 +130,13 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Class<?> resolveClassName(String candidate, ClassLoader classLoader) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
return ClassUtils.resolveClassName(candidate, classLoader);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (IllegalArgumentException ex) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|