``++@ComponentScan++`` is used to determine which Spring Beans are available in the application context. The packages to scan can be configured thanks to the ``++basePackageClasses++`` or ``++basePackages++`` (or its alias ``++value++``) parameters. If neither parameter is configured, ``++@ComponentScan++`` will consider only the package of the class annotated with it. When ``++@ComponentScan++`` is used on a class belonging to the default package, the entire classpath will be scanned.
This will slow-down the start-up of the application and it is likely the application will fail to start with an ``++BeanDefinitionStoreException++`` because you ended up scanning the Spring Framework package itself.
This rule raises an issue when:
* ``++@ComponentScan++``, ``++@SpringBootApplication++`` and ``++@ServletComponentScan++`` are used on a class belonging to the default package
* ``++@ComponentScan++`` is explicitly configured with the default package
\[~alexandre.gigleux] I've made a couple small edits, but there are phrases that still need attention.
____
@ComponentScan (and so @SpringBootApplication that is annotated with @ComponentScan)
____
Can the parenthetical phrase be eliminated? Or clarified somehow?
____
This will not help to speed up the start-up of the application
____
Can we just say it will slow it down? Or might there actually be an expectation that startup would be faster? If so, it would be useful to elaborate on that.
=== on 21 Apr 2018, 21:01:23 Alexandre Gigleux wrote: