首页 > 其他分享 >spring boot下的三种包扫描

spring boot下的三种包扫描

时间:2022-12-03 12:13:12浏览次数:47  
标签:spring boot 扫描 ComponentScan db SpringCloud

扫描的包名是:资源名(Source name)

// 启动类扫描
@SpringBootApplication(scanBasePackages ={"springcloud.client01","springcloud.common.db.utils"})

// mapper注解扫描
@MapperScan(basePackages = {"com.changgou.goods.dao"})

// 组件扫描
@ComponentScans(value = {@ComponentScan("SpringCloud.common.db"),@ComponentScan("SpringCloud.client01")})

标签:spring,boot,扫描,ComponentScan,db,SpringCloud
From: https://www.cnblogs.com/lambertlt/p/16947291.html

相关文章