boolean (@Nullable Project projectToUpdate, @NotNull Path root) { getParameters().myFiles = null; getParameters().myMavenProjectTree = null; // We cannot determinate project in non-EDT thread. getParameters().myProjectToUpdate = projectToUpdate != null ? projectToUpdate : ProjectManager.getInstance().getDefaultProject(); return runConfigurationProcess(MavenProjectBundle.message("maven.scanning.projects"), new MavenTask() { @Override public void run(MavenProgressIndicator indicator) throws MavenProcessCanceledException { indicator.setText(MavenProjectBundle.message("maven.locating.files")); getParameters().myImportRootDirectory = root; if (getParameters().myImportRootDirectory == null) { throw new MavenProcessCanceledException(); } getParameters().myFiles = getProjectFiles(indicator); readMavenProjectTree(indicator); indicator.setText(""); indicator.setText2(""); } }); }