@ -965,6 +965,7 @@ NOTE: DevTools relies on the application context's shutdown hook to close it dur
@@ -965,6 +965,7 @@ NOTE: DevTools relies on the application context's shutdown hook to close it dur
restart. It will not work correctly if you have disabled the shutdown hook (
The restart technology provided by Spring Boot works by using two classloaders.
@ -975,12 +976,12 @@ and a new one is created. This approach means that application restarts are typi
@@ -975,12 +976,12 @@ and a new one is created. This approach means that application restarts are typi
faster than "`cold starts`" since the _base_ classloader is already available and
populated.
If you find that restarts aren't quick enough for your applications, you could consider
reloading technologies such as http://zeroturnaround.com/software/jrebel/[JRebel] from
ZeroTurnaround. These work by rewriting classes as they are loaded to make them more
amenable to reloading. https://github.com/spring-projects/spring-loaded[Spring Loaded]
provides another option, however it doesn't support as many frameworks and it isn't
commercially supported.
If you find that restarts aren't quick enough for your applications, or you encounter
classloading issues, you could consider reloading technologies such as
http://zeroturnaround.com/software/jrebel/[JRebel] from ZeroTurnaround. These work by
rewriting classes as they are loaded to make them more amenable to reloading.
https://github.com/spring-projects/spring-loaded[Spring Loaded] provides another option,
however it doesn't support as many frameworks and it isn't commercially supported.
****
@ -1052,6 +1053,52 @@ in the same way.
@@ -1052,6 +1053,52 @@ in the same way.
[[using-boot-devtools-customizing-classload]]
==== Customizing the restart classloader
As described in the <<using-spring-boot-restart-vs-reload>> section above, restart
functionality is implemented by using two classloaders. For most applications this
approach works well, however, sometimes in can cause classloading issues.
By default, any open project in your IDE will be loaded using the "`restart`" classloader,
and any regular `.jar` file will be loaded using the "`base`" classloader. If you work on
a multi-module project, and not each module is imported into your IDE, you may need to
customize things. To do this you can create a `META-INF/spring-devtools.properties` file.
The `spring-devtools.properties` file can contain `restart.exclude.` and
`restart.include.` prefixed properties. The `include` elements are items that should be
pulled-up into the "`restart`" classloader, and the `exclude` elements are items that
should be pushed down into the "`base`" classloader. The value of the property is a regex