void (@NotNull Document document, @NotNull MavenDomProjectModel model, @NotNull LanguageLevel level) { XmlTag tag = MavenProjectModelModifier.getCompilerPlugin(model).getConfiguration().ensureTagExists(); String option = JpsJavaSdkType.complianceOption(level.toJavaVersion()); String prevTargetValue = setChildTagIfAbsent(tag, LanguageLevelPluginQuickFix.COMPILER_TARGET, option); String targetValue = Optional.ofNullable(tag.findFirstSubTag(LanguageLevelPluginQuickFix.COMPILER_SOURCE)) .map(sourceTag -> sourceTag.getValue()) .map(t -> t.getText()) .orElse(option); PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document); FileDocumentManager.getInstance().saveDocument(document); tag = MavenProjectModelModifier.getCompilerPlugin(model).getConfiguration().ensureTagExists(); Template template = getTemplate(tag, prevTargetValue, targetValue); runTemplate(template, tag); }