From 35388b6d9508c545569693009f9470350c394ab9 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 14 Dec 2015 15:16:30 +0100 Subject: [PATCH] Clarify usage of Devtools with build plugins Closes gh-4756 --- .../src/main/asciidoc/using-spring-boot.adoc | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 1d58eddec7..e5224c16df 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -823,8 +823,7 @@ This allows you to attach a debugger to your packaged application: [[using-boot-running-with-the-maven-plugin]] === Using the Maven plugin The Spring Boot Maven plugin includes a `run` goal which can be used to quickly compile -and run your application. Applications run in an exploded form, and you can edit -resources for instant "`hot`" reload. +and run your application. Applications run in an exploded form just like in your IDE. [indent=0,subs="attributes"] ---- @@ -952,9 +951,37 @@ updated and trigger a restart. In IntelliJ IDEA, building the project (`Build -> Project`) will have the same effect. **** -NOTE: You can also start your application via the supported build plugins (i.e. Maven and +[NOTE] +==== +You can also start your application via the supported build plugins (i.e. Maven and Gradle) as long as forking is enabled since DevTools need an isolated application -classloader to operate properly. +classloader to operate properly. You can force the plugin to fork the process as +follows: + +.Maven +[source,xml,indent=0,subs="verbatim,quotes,attributes"] +---- + + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + +---- + +.Gradle +[source,groovy,indent=0,subs="verbatim,attributes"] +---- + bootRun { + addResources = true + } +---- +==== TIP: Automatic restart works very well when used with LiveReload. <> for details. If you use JRebel automatic