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
You can also include specific package and excludes them like :
Include and exclude (both)
@SpringBootApplication
(
scanBasePackages = {
"com.package1",
"com.package2"
},
exclude = {org.springframework.boot.sample.class}
)
JUST Exclude
@SpringBootApplication(exclude= {com.package1.class})
public class MySpringConfiguration {}