System.out.println("Server runtime created: " + runtime.getName());
System.out.println("Creating server instance...");
final ServerWorkingCopy swc = (ServerWorkingCopy) serverType.createServer(null, null, runtime, monitor);
swc.setName(serverName + " GENERATED");
swc.setAttribute("server-type", serverType.getId());
m = swc.getAttribute("generic_server_instance_properties", (Map) null);
m.put("key", "generic_server_instance_properties");
m.putAll(serverProperties);
swc.setAttribute("generic_server_instance_properties", m);
final String modules = pf.getProperty("modules");
IModule[] add = new IModule[0];
if (modules != null)
{
final String[] strmodules = modules.split(" ,;");
add = new IModule[strmodules.length];
for (int i = 0; i < strmodules.length; i++)
{
add[i] = ServerUtil.getModule(ResourcesPlugin.getWorkspace().getRoot().getProject(strmodules[i]));
}
}
System.out.println("Modules to assign to server: " + Arrays.asList(add));
swc.modifyModules(add, new IModule[0], monitor);
server = swc.save(true, monitor);
System.out.println("Server instance created: " + server.getName());
}
else
{