如何在 IntelliJ Spring Boot 项目中添加环境变量

Ser*_*rrr 9 java jetbrains-ide intellij-idea spring-boot

我正在尝试在我的 spring-boot 文件中添加一个环境变量application.properties。我知道如何在非 spring-boot 项目上正常添加它,但我找不到添加环境变量的字段,这就是我看到的:

这就是我所看到的

这是我的 application.properties 文件,这可能会有所帮助。

spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/FTHLDB
spring.datasource.username=root
spring.datasource.password=${MYSQL_PASS}
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.format_sql=true
Run Code Online (Sandbox Code Playgroud)

小智 32

运行/调试配置的 UI 已更改。在“修改选项”下,选择“操作系统”下的“环境变量”。

说明截图