From 3f528bb0eb7049d05c8f63b06ab9b4873a72d02c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 30 Apr 2021 08:47:45 +0200 Subject: [PATCH] Mark SpringBootConfiguration as Indexed Previously, users of the components.index could not use the index in scenario where Spring Boot needs to locate the SpringBootConfiguration to use to bootstrap the test context, as AnnotatedClassFinder scans the classpath for that stereotype specifically and that requires a dedicated entry for it. This commit makes sure that a SpringBootConfiguration-annotated type has a dedicated entry in the components index. Closes gh-26308 --- .../org/springframework/boot/SpringBootConfiguration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java index b5684bd98a3..b888fe04e23 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringBootConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2021 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import java.lang.annotation.Target; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AliasFor; +import org.springframework.stereotype.Indexed; /** * Indicates that a class provides Spring Boot application @@ -44,6 +45,7 @@ import org.springframework.core.annotation.AliasFor; @Retention(RetentionPolicy.RUNTIME) @Documented @Configuration +@Indexed public @interface SpringBootConfiguration { /**