在Visual Code启动文件中编辑spring-boot应用程序配置环境变量



可以在Visual Code中编辑spring-boot应用程序配置环境变量吗?在eclipse(STS(中,可以通过转到DebugConfiguration>gt;春季启动应用程序>gt;配置>gt;环境变量。

有什么方法可以在Visual Code中通过编辑一些启动文件来做到这一点吗?

如果它没有完成,每次我运行它时都会出现错误:


***************************
APPLICATION FAILED TO START
***************************
Description:
Field userInfo in blabla2 required a bean of type 'com.blabla3.UserInfo' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Qualifier(value=Pro)

Action:
Consider defining a bean of type 'com.blabla3.UserInfo' in your configuration.

是的,您可以使用Run > Open Configurations编辑启动文件。然后,添加以下行:

"env": {
"MY_ENV_VARIABLE": "value1",
"SECOND_ENV_VARIABLE":"value2"
},

相关内容

最新更新