【问题标题】:Append profile to other spring-profiles将配置文件附加到其他弹簧配置文件
【发布时间】:2020-02-04 10:49:48
【问题描述】:

我可以在测试中配置 activeProfiles 以使用

@ActiveProfiles("mynewone")
@RunWith(SpringJUnit4ClassRunner.class)
public class FooTest extends AbstractIntTest 

我不明白 spring-documentation 如何将我的配置文件“mynewone”添加到已经运行的配置文件中。如果我像上面那样配置它,只有“mynewone”处于活动状态。

【问题讨论】:

    标签: spring spring-boot spring-profiles


    【解决方案1】:

    在应用程序属性文件中使用spring.profiles.include=mynewone

    【讨论】:

    • 这是可能的。但我想以编程方式添加一个活动配置文件。我写了“mynewone”,所有配置的活动配置文件都被覆盖了。
    猜你喜欢
    • 1970-01-01
    • 2020-06-18
    • 2018-11-27
    • 2016-07-28
    • 2012-11-02
    • 1970-01-01
    • 1970-01-01
    • 2014-10-14
    • 2020-05-28
    相关资源
    最近更新 更多