Skip to content

Commit 0067144

Browse files
committed
add module check
1 parent 3182b86 commit 0067144

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

avaje-config/src/main/java/io/avaje/config/Parsers.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ final class Parsers {
2424

2525
private void initYamlParser() {
2626
YamlLoader yamlLoader;
27+
if (ModuleLayer.boot().findModule("org.yaml.snakeyaml").isPresent()) {
28+
yamlLoader = new YamlLoaderSnake();
29+
parserMap.put("yml", yamlLoader);
30+
parserMap.put("yaml", yamlLoader);
31+
return;
32+
}
2733
try {
2834
yamlLoader = new YamlLoaderSnake();
2935
} catch (NoClassDefFoundError e) {

0 commit comments

Comments
 (0)