ArrayList<File> files = new ArrayList<>();
String path = "..".concat(File.separator.concat("main project").concat(File.separator).concat("target").concat(File.separator));
String artifact = "main project-".concat(VERSION).concat("-SNAPSHOT.ear");
files.add(new File(path.concat(artifact)));
path = "..".concat(File.separator.concat("dependent project").concat(File.separator).concat("target").concat(File.separator));
artifact = "dependent project-".concat(VERSION).concat("-SNAPSHOT-with-jar-dependencies.jar");
files.add(new File(path.concat(artifact)));
path = "..".concat(File.separator.concat("independent project").concat(File.separator).concat("target").concat(File.separator));
artifact = "independent project-".concat(VERSION).concat("-SNAPSHOT-with-jar-dependencies.jar");
files.add(new File(path.concat(artifact)));
File[] artifacts = new File[files.size()];
artifacts = files.toArray(artifacts);
ejbProperties.put("org.glassfish.ejb.embedded.glassfish.installation.root", installationRoot);
ejbProperties.put("org.glassfish.ejb.embedded.glassfish.instance.root", instanceRoot);
ejbProperties.put("org.glassfish.ejb.embedded.glassfish.configuration.file", configFile);
ejbProperties.put("org.glassfish.ejb.embedded.glassfish.instance.reuse", "true");
ejbProperties.put("org.glassfish.ejb.embedded.keep-temporary-files", "true");
// Add the modules from above here
ejbProperties.put(EJBContainer.MODULES, classFiles);
container = EJBContainer.createEJBContainer(ejbProperties);