diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java index 8a0f53208f78c..0906bd9e943b7 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/catalog/processor/MetadataValue.java @@ -72,7 +72,11 @@ public > T toEnum(Class clazz, T defaultValue) { if (name == null) { return defaultValue; } - return T.valueOf(clazz, name.toUpperCase(Locale.ROOT).replace('-', '_')); + try { + return T.valueOf(clazz, name.toUpperCase(Locale.ROOT).replace('-', '_')); + } catch (IllegalArgumentException e) { + return defaultValue; + } } }