我想添加依赖spring-boot-devtools
但仅用于开发。我尝试通过在我的以下代码段中实现这一点build.gradle
:
if (project.hasProperty('use-spring-boot-devtools')) {
compile 'org.springframework.boot:spring-boot-devtools'
}
然后我可以在我的~/.gradle/gradle.properties
use-spring-boot-devtools = true
不幸的是,当我在 IDEA 中运行导入项目时,这不起作用。我想使用相关问题的答案,但仍然无法弄清楚如何定义会影响 IDEA 内部 gradle 的环境变量。