springboot一定要添加扫描

springboot一定要添加扫描,要不然有可能会找不到bean、service、controller之类的

@SpringBootApplication
@ComponentScan("com.nbkj.fossx.engine.repository")
@ComponentScan("com.nbkj.fossx.engine")
public class Start {
    public static void main(String[] args) {
        SpringApplication.run(Start.class,args);
    }
}

 

posted on 2022-11-08 15:28  影子BLH  阅读(190)  评论(0)    收藏  举报