String (@Nullable VirtualFile file, @NotNull Project project) { VirtualFile directory = file == null ? null : file.getParent(); MavenDistribution distribution; if (directory == null) { distribution = MavenDistributionsCache.getInstance(project).getSettingsDistribution(); } else { distribution = MavenDistributionsCache.getInstance(project).getMavenDistribution(directory.getPath()); } return distribution.getVersion(); }