spring-boot设置启动之后执行的代码

用目前最新的2.0.5.RELEASE,以前旧版的总报错,也没时间研究更底层的代码。

package com.geewise.url.common.config;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class StartInfo implements CommandLineRunner {
    @Override
    public void run(String... args) throws Exception {
        System.out.println("url-sys启动成功");
    }
}

 在run里面可以添加启动完成之后的操作

猜你喜欢

转载自blog.csdn.net/qq_20552525/article/details/83056895