Index @ConfigurationProperties so they can be found by scanning

Previously, @ConfigurationProperties was not annotated with @Indexed.
This meant that @ConfigurationPropertiesScan would not be able to
find them when the underlying
ClassPathScanningCandidateComponentProvider is using a
CandidateComponentsIndex.

This commit annotated @ConfigurationProperties with @Indexed so that
they can be found by index-based scanning.

Fixes gh-26459
This commit is contained in:
Andy Wilkinson
2021-05-14 13:41:24 +01:00
parent 444474926c
commit 5984d4ee2b

View File

@@ -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.
@@ -23,6 +23,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Indexed;
/**
* Annotation for externalized configuration. Add this to a class definition or a
@@ -46,6 +47,7 @@ import org.springframework.core.annotation.AliasFor;
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Indexed
public @interface ConfigurationProperties {
/**