在JetBrains Fleet中配置环境变量运行Spring Boot应用
在JetBrains Fleet中配置Spring Boot运行环境变量的位置
Fleet的运行配置存放在项目根目录下的.fleet/run.json文件中,你需要把environment对象嵌套在对应Spring Boot应用的配置项内部。
以下是完整的配置示例:
{ "configurations": [ { "type": "Spring Boot", "name": "My Spring Boot App", "environment": { "TEMP_DIR": "/home/user/temp", "GENERATE_RANDOM_PASSWORD": "true" }, "mainClass": "com.example.MyApplication", "module": "my-app" } ] }
- 若项目中没有
.fleet/run.json,直接在根目录创建.fleet文件夹,再新建run.json文件即可。 - 配置项的
type必须设为Spring Boot,Fleet才能识别这是Spring Boot应用的运行配置。 - 同时要补充
mainClass(你的应用主类全路径)和module(对应模块名称)这类必填参数,确保Fleet能正常启动应用。
内容的提问来源于stack exchange,提问作者Jadson Santos
相关产品推荐
相关产品推荐

