【发布时间】:2025-12-26 07:05:07
【问题描述】:
我本质上想在 gradle 中创建一个执行命令的任务
gradle bootRun -Dspring.profiles.active=test
如果从命令行执行,此命令完全符合我的要求,但我没有运气尝试在任务上使用type:Exec,也没有运气传递System properties
我真的不想把它变成用户需要知道才能运行的外部命令。我希望它显示在任务/其他下。
到目前为止我最接近的尝试:
task bootRunTest() {
executable "gradle"
args "-Dspring.profiles.active=test bootRun"
}
【问题讨论】:
标签: spring gradle spring-boot