I am puzzled by this block of code to be used in a gradle
file, suggested by Spring Boot Documentation on Developer Tools
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
}
I think I must declare the developmentOnly
configuration because it is to be used in the dependencies {}
block, but why do I need the lines for runtimeClasspath
? I actually tried removing the lines in my project and the project built prefectly fine.
configurations {
developmentOnly
}
dependencies {
developmentOnly("org.springframework.boot:spring-boot-devtools")
}
Is runtimeClasspath
used by the Java Plugin? (As suggested by this doc) Will there be any bad side-effect if I do not include those lines for runtimeClasspath
?
Update (2019-12-10)
I can also confirm that the built executable jar built without the runtimeClasspath
directive ran prefectly okay. So I really don't know what that directive is doing.
runtimeClasspath
is somehow used by someone, but I don't know how and who. I have already re-read the documentation on the Java Plugin -- to no avail. docs.gradle.org/current/userguide/building_java_projects.html – Koren