Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
6bd438a7
Commit
6bd438a7
authored
Jul 26, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document `@ConditionalOnProperty` limitation with collections
Closes gh-7483
parent
57515dfa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
ConditionalOnProperty.java
...k/boot/autoconfigure/condition/ConditionalOnProperty.java
+15
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnProperty.java
View file @
6bd438a7
...
...
@@ -22,6 +22,7 @@ import java.lang.annotation.Retention;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
import
org.springframework.boot.autoconfigure.couchbase.OnBootstrapHostsCondition
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.core.env.Environment
;
...
...
@@ -72,6 +73,20 @@ import org.springframework.core.env.Environment;
* {@link #matchIfMissing()} attribute is consulted. By default missing attributes do not
* match.
*
* <p>
* This condition cannot be reliably used for matching collection properties. For example,
* in the following configuration, the condition matches if {@code spring.example.values}
* is present in the {@link Environment} but does not match if {@code spring.example.values[0]} is present.
*
* <pre class="code">
* @ConditionalOnProperty(prefix = "spring", name = "example.values")
* class ExampleAutoConfiguration {
* }
* </pre>
*
* It is better to use a custom condition for such cases.
* See {@link OnBootstrapHostsCondition} for an example of a custom condition.
*
* @author Maciej Walkowiak
* @author Stephane Nicoll
* @author Phillip Webb
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment