Spring @Autowired 调用别的包下的Bean 解决方法

需要加入注解@ComponentScan(basePackages="bean所在的包名")

example:

 

@SpringBootApplication
@ComponentScan(basePackages="com.,abc.")
public class TechproofApplication {
}
posted @ 2019-06-26 15:23  bolddream  阅读(1913)  评论(0编辑  收藏  举报