Skip to content

Commit

Permalink
Do mvn test app import 1-at-a-time
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Kurz <[email protected]>
  • Loading branch information
scottkurz committed Sep 14, 2023
1 parent a569d82 commit 431030e
Showing 1 changed file with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,25 @@ public static void importMavenProjects(File workspaceRoot, List<String> folders)

// Get the list of projects to install.
MavenModelManager modelManager = MavenPlugin.getMavenModelManager();
LocalProjectScanner lps = new LocalProjectScanner(folders, false, modelManager);
lps.run(new NullProgressMonitor());
List<MavenProjectInfo> projects = lps.getProjects();

// Import the projects.
ProjectImportConfiguration projectImportConfig = new ProjectImportConfiguration();
IProjectConfigurationManager projectConfigurationManager = MavenPlugin.getProjectConfigurationManager();
projectConfigurationManager.importProjects(projects, projectImportConfig, new NullProgressMonitor());

for (String folder : folders) {
ArrayList<String> folderList = new ArrayList<String>();
folderList.add(folder);

LocalProjectScanner lps = new LocalProjectScanner(folderList, false, modelManager);
lps.run(new NullProgressMonitor());
List<MavenProjectInfo> projects = lps.getProjects();

try {
// Import the projects.
ProjectImportConfiguration projectImportConfig = new ProjectImportConfiguration();
IProjectConfigurationManager projectConfigurationManager = MavenPlugin.getProjectConfigurationManager();
projectConfigurationManager.importProjects(projects, projectImportConfig, new NullProgressMonitor());
} catch (Exception e) {
System.out.println("Exception in importMavenProjects importing project = " + folder);
e.printStackTrace();
}
}
}

/**
Expand Down

0 comments on commit 431030e

Please sign in to comment.