首页 > 解决方案 > 将 application.yml 文件(在我的应用程序中可用)读入 spring boot 中添加的依赖模块

问题描述

我正在使用弹簧靴。我要求我的依赖项目应该读取我的应用程序的 application.yml。

示例: 应用程序的 application.yml

  mapping:
    AB: ABCD
    CD: EFGH

注意:依赖模块没有任何 application.yml

有可能实现这一目标吗?

标签: springapplication.properties

解决方案


@Value您可以在依赖项目类中使用这些属性。


推荐阅读