1
1
/*
2
- * Copyright 2012-2020 the original author or authors.
2
+ * Copyright 2012-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
27
27
import org .apache .commons .logging .Log ;
28
28
import org .apache .commons .logging .LogFactory ;
29
29
30
+ import org .springframework .boot .DefaultPropertiesPropertySource ;
31
+ import org .springframework .boot .context .properties .source .ConfigurationPropertySources ;
30
32
import org .springframework .cloud .autoconfigure .RefreshAutoConfiguration ;
31
33
import org .springframework .cloud .context .environment .EnvironmentChangeEvent ;
32
34
import org .springframework .cloud .context .scope .refresh .RefreshScope ;
@@ -52,16 +54,21 @@ public abstract class ContextRefresher {
52
54
53
55
protected static final String REFRESH_ARGS_PROPERTY_SOURCE = "refreshArgs" ;
54
56
57
+ /**
58
+ * see {@link ConfigurationPropertySources#ATTACHED_PROPERTY_SOURCE_NAME}.
59
+ */
60
+ private static final String ATTACHED_PROPERTY_SOURCE_NAME = "configurationProperties" ;
61
+
55
62
protected static final String [] DEFAULT_PROPERTY_SOURCES = new String [] {
56
63
// order matters, if cli args aren't first, things get messy
57
- CommandLinePropertySource .COMMAND_LINE_PROPERTY_SOURCE_NAME , "defaultProperties" };
64
+ CommandLinePropertySource .COMMAND_LINE_PROPERTY_SOURCE_NAME , DefaultPropertiesPropertySource . NAME };
58
65
59
66
protected Set <String > standardSources = new HashSet <>(
60
67
Arrays .asList (StandardEnvironment .SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME ,
61
68
StandardEnvironment .SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME ,
62
69
StandardServletEnvironment .JNDI_PROPERTY_SOURCE_NAME ,
63
70
StandardServletEnvironment .SERVLET_CONFIG_PROPERTY_SOURCE_NAME ,
64
- StandardServletEnvironment .SERVLET_CONTEXT_PROPERTY_SOURCE_NAME , "configurationProperties" ));
71
+ StandardServletEnvironment .SERVLET_CONTEXT_PROPERTY_SOURCE_NAME , ATTACHED_PROPERTY_SOURCE_NAME ));
65
72
66
73
protected final List <String > additionalPropertySourcesToRetain ;
67
74
0 commit comments