/** * @author jingke */ @SpringBootApplication @ComponentScan(basePackages = {"com.ancun.common.service", "com.ancun.common.controller", "com.ancun.common.repository", "com.ancun.common.model", "com.ancun.common.sysconfig"}) public class ApplicationStart { /** * http://localhost:8080/renren-admin * @param args */ public static void main(String[] args) { SpringApplication.run(ApplicationStart.class, args); } @Bean public CommandLineRunner commandLineRunner(ApplicationContext ctx) { return args -> { System.out.println("Let's inspect the beans provided by Spring Boot:"); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { System.out.println(beanName); } }; } }
springboot打印扫描到的的bean
最新推荐文章于 2024-03-21 16:00:25 发布