关闭。这个问题是opinion-based.它目前不接受答案。想要改进这个问题吗?更新问题,以便editingthispost提供事实和引用来回答它.关闭7年前。ImprovethisquestionSpring的@ComponentScan提供了一个类型安全的basePackageClasses属性-使用起来似乎是一件好事,特别是因为在我正在处理的项目中重命名包的情况并不少见。文档说:Considercreatingaspecialno-opmarkerclassorinterfaceineachpackagethatservesnopurposeotherthanbeingrefe