From 503a450d0b587f6df493d7e2cb5caadef96a0ef0 Mon Sep 17 00:00:00 2001 From: Scott Kurz Date: Thu, 14 Sep 2023 11:29:12 -0400 Subject: [PATCH] Do mvn test app import 1-at-a-time Signed-off-by: Scott Kurz --- .../it/AbstractLibertyPluginSWTBotTest.java | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java index bd420222..ebef6a0a 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/AbstractLibertyPluginSWTBotTest.java @@ -126,14 +126,24 @@ public static void importMavenProjects(File workspaceRoot, List folders) // Get the list of projects to install. MavenModelManager modelManager = MavenPlugin.getMavenModelManager(); - LocalProjectScanner lps = new LocalProjectScanner(folders, false, modelManager); - lps.run(new NullProgressMonitor()); - List 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 folderList = new ArrayList(); + folderList.add(folder); + + LocalProjectScanner lps = new LocalProjectScanner(folderList, false, modelManager); + lps.run(new NullProgressMonitor()); + List 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(); + } + } } /**