com.suchtool.nicetool.util.spring.SpringBootUtil Maven / Gradle / Ivy
package com.suchtool.nicetool.util.spring;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.Map;
public class SpringBootUtil {
public static String parseRunClassPackage() {
Map runClassBeanMap = ApplicationContextHolder.getContext()
.getBeansWithAnnotation(SpringBootApplication.class);
Object runObject = runClassBeanMap.entrySet().iterator().next().getValue();
return AopUtil.getTargetClass(runObject).getPackage().getName();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy