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 503a450
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,24 @@ 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) {
e.printStackTrace();
}
}
}

/**
Expand Down

0 comments on commit 503a450

Please sign in to comment.