Exclude subpackages from Spring autowiring?

后端 未结 9 940
傲寒
傲寒 2020-12-02 10:00

Is there a simple way to exclude a package / sub-package from autowiring in Spring 3.1?

E.g., if I wanted to include a component scan with a base package of co

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 10:57

    I think you should refactor your packages in more convenient hierarchy, so they are out of the base package.

    But if you can't do this, try:

    
        ...
        
    
    

    Here you could find more examples: Using filters to customize scanning

提交回复
热议问题