diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java index 6b24bdb729..981e71e6ca 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java @@ -31,6 +31,7 @@ import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.core.annotation.AliasFor; +import org.springframework.data.repository.Repository; /** * Indicates a {@link Configuration configuration} class that declares one or more @@ -72,6 +73,12 @@ public @interface SpringBootApplication { /** * Base packages to scan for annotated components. Use {@link #scanBasePackageClasses} * for a type-safe alternative to String-based package names. + *
+ * Note: this setting is an alias for + * {@link ComponentScan @ComponentScan} only. It has no effect on {@code @Entity} + * scanning or Spring Data {@link Repository} scanning. For those you should add + * {@link org.springframework.boot.autoconfigure.domain.EntityScan @EntityScan} and + * {@code @Enable...Repositories} annotations. * @return base packages to scan * @since 1.3.0 */ @@ -84,6 +91,12 @@ public @interface SpringBootApplication { *
* Consider creating a special no-op marker class or interface in each package that * serves no purpose other than being referenced by this attribute. + *
+ * Note: this setting is an alias for + * {@link ComponentScan @ComponentScan} only. It has no effect on {@code @Entity} + * scanning or Spring Data {@link Repository} scanning. For those you should add + * {@link org.springframework.boot.autoconfigure.domain.EntityScan @EntityScan} and + * {@code @Enable...Repositories} annotations. * @return base packages to scan * @since 1.3.0 */