LanguageLevel (@NotNull MavenProject mavenProject, @NotNull Supplier<LanguageLevel> supplier) { LanguageLevel level = null; Element cfg = mavenProject.getPluginConfiguration("com.googlecode", "maven-idea-plugin"); if (cfg != null) { level = MAVEN_IDEA_PLUGIN_LEVELS.get(cfg.getChildTextTrim("jdkLevel")); } if (level == null) { level = supplier.get(); } // default source and target settings of maven-compiler-plugin is 1.5 for versions less than 3.8.1 and 1.6 for 3.8.1 and above // see details at http://maven.apache.org/plugins/maven-compiler-plugin and https://issues.apache.org/jira/browse/MCOMPILER-335 if (level == null) { level = getDefaultLevel(mavenProject); } if (level.isAtLeast(LanguageLevel.JDK_11)) { level = adjustPreviewLanguageLevel(mavenProject, level); } return level; }