Skip to content

Commit 0f9a215

Browse files
committed
fix - #15193 if no spring profile is defined, assume the environment
1 parent 7f9a2c0 commit 0f9a215

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

grails-bootstrap/src/main/groovy/org/grails/config/NavigableMap.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import org.codehaus.groovy.runtime.DefaultGroovyMethods
2828
import org.slf4j.Logger
2929
import org.slf4j.LoggerFactory
3030

31+
import grails.util.Environment
32+
3133
/**
3234
* @deprecated This class is deprecated to reduce complexity, improve performance, and increase maintainability. Use {@code config.getProperty(String key, Class<T> targetType)} instead.
3335
*/
@@ -187,7 +189,7 @@ class NavigableMap implements Map<String, Object>, Cloneable {
187189
private static boolean springProfileExclude(Map sourceMap, String path) {
188190

189191
// Is there an active Spring profile?
190-
def activeSpringProfile = System.getProperty(SPRING_PROFILES)
192+
def activeSpringProfile = System.getProperty(SPRING_PROFILES) ?: Environment.current.name
191193

192194
// Is there a 'spring.config.activate.on-profile' property defined in the source map?
193195
def sourceMapProfile1 = ((Map) ((Map)((Map)sourceMap?.get(SPRING))?.get(CONFIG))?.get(ACTIVATE))?.get(ON_PROFILE)

0 commit comments

Comments
 (0)