# @ComponentScan 无参数

**URL:** <https://www.isharkfly.com/t/componentscan/426>\
**Category:** 程序语言\
**Tags:** spring, java\
**Created:** [September 1, 2020, 4:47am UTC](https://www.isharkfly.com/t/componentscan/426 "2020-09-01T04:47:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [September 1, 2020, 4:47am UTC](https://www.isharkfly.com/t/componentscan/426/1 "2020-09-01T04:47:22Z")

</div>

Spring @ComponentScan 无参数的组件扫描路径是什么

## 问题解答

在 Spring 中，我们使用 @ComponentScan 和 @Configuration 注解来指定希望扫描的 Package。

如果你使用的 @ComponentScan 的话，将会扫描当前文件夹和所有的子文件夹。
