SpringBoot 启动参数及vm参数获取

image

    @Autowired
    private ApplicationArguments applicationArguments;

    @Autowired
    private ApplicationContext applicationContext;

    main方法通过ApplicationArguments获取
    vm可以通过System.getProperties()或 applicationContext.getEnvironment()

image

posted @ 2022-10-19 11:51  Acaak  阅读(645)  评论(0)    收藏  举报