【发布时间】:2025-12-12 21:30:03
【问题描述】:
我有一个spring boot 应用程序,当我start-up 时,我想在commandLine 中传递application.properties 文件。
即当我运行mvn spring-boot:run --application.properties
我将在src/main/resources 中有一个默认的 application.properties。但这仅用于testing 目的。在production 运行中,我想在commandLine. 中传递property file
我知道传递单个参数,例如
mvn spring-boot:run --server.port=9001.
但我有很多这样的属性,如果可能的话,我更愿意传递一个属性文件。
【问题讨论】:
标签: spring-boot spring-4