File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
spring-boot-project/spring-boot-docs/src/main/asciidoc Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -747,16 +747,23 @@ listings for Maven and Gradle:
747
747
.Gradle
748
748
[source,groovy,indent=0,subs="attributes"]
749
749
----
750
+ configurations {
751
+ developmentOnly
752
+ runtimeClasspath {
753
+ extendsFrom developmentOnly
754
+ }
755
+ }
750
756
dependencies {
751
- compile ("org.springframework.boot:spring-boot-devtools")
757
+ developmentOnly ("org.springframework.boot:spring-boot-devtools")
752
758
}
753
759
----
754
760
755
761
NOTE: Developer tools are automatically disabled when running a fully packaged
756
762
application. If your application is launched from `java -jar` or if it is started from a
757
763
special classloader, then it is considered a "`production application`". Flagging the
758
- dependency as optional in Maven or using `compileOnly` in Gradle is a best practice that
759
- prevents devtools from being transitively applied to other modules that use your project.
764
+ dependency as optional in Maven or using a custom`developmentOnly` configuration in
765
+ Gradle (as shown above) is a best practice that prevents devtools from being transitively
766
+ applied to other modules that use your project.
760
767
761
768
TIP: Repackaged archives do not contain devtools by default. If you want to use a
762
769
<<using-boot-devtools-remote,certain remote devtools feature>>, you need to disable the
You can’t perform that action at this time.
0 commit comments