[MNG-8178] Fall back to system properties for missing profile activation context properties (#1609)

Missed port to the build implementation from f2a0865
This commit is contained in:
Guillaume Nodet 2024-09-30 17:02:23 +02:00
parent 885a4b3a26
commit fcb8147268
1 changed files with 9 additions and 3 deletions

View File

@ -56,9 +56,15 @@ public class OperatingSystemProfileActivator implements ProfileActivator {
boolean active = ensureAtLeastOneNonNull(os);
String actualOsName = context.getSystemProperties().get("os.name").toLowerCase(Locale.ENGLISH);
String actualOsArch = context.getSystemProperties().get("os.arch").toLowerCase(Locale.ENGLISH);
String actualOsVersion = context.getSystemProperties().get("os.version").toLowerCase(Locale.ENGLISH);
String actualOsName = context.getSystemProperties()
.getOrDefault("os.name", Os.OS_NAME)
.toLowerCase(Locale.ENGLISH);
String actualOsArch = context.getSystemProperties()
.getOrDefault("os.arch", Os.OS_ARCH)
.toLowerCase(Locale.ENGLISH);
String actualOsVersion = context.getSystemProperties()
.getOrDefault("os.version", Os.OS_VERSION)
.toLowerCase(Locale.ENGLISH);
if (active && os.getFamily() != null) {
active = determineFamilyMatch(os.getFamily(), actualOsName);