获取Spring-boot系统环境变量方法

    public static ConfigurableApplicationContext  context = null;



    public static void main( String[] args ) throws Exception

    {

        //1. start application

        context = SpringApplication.run( App.class, args );
       String selfUrl
=App.context.getEnvironment().getProperty("ta.selfcheck.url"); }

 

你可能感兴趣的:(spring-boot)