springboot 获取项目绝对路径
ClassUtils.getDefaultClassLoader().getResource("").getPath();
添加类
package com.ps.uzkefu.apps.ctilink.config;
/**
* Author:ZhuShangJin
* Date:2018/6/26
*/
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* Created by pangkunkun on 2017/9/3.
*/
@Component
public class EventApplicationRunner implements ApplicationRunner {
@Override
public void run(ApplicationArguments var1) throws Exception{
//启动后执行
System.out.println("MyApplicationRunner class will be execute when the project was started!");
}
}