Files.readable(workingDirectory);
Files.writable(workingDirectory);
openejbHome = Setup.findHome(workingDirectory);
Installer installer = null;
if (openejbHome == null) {
downloadTomcat(workingDirectory, configuration.getTomcatVersion());
openejbHome = Setup.findHome(workingDirectory);
Files.deleteOnExit(openejbHome);
final File webapp = new File(openejbHome, "webapps" + s + "tomee");
Files.mkdir(webapp);
downloadOpenEJBWebapp(webapp);
System.setProperty("catalina.home", openejbHome.getAbsolutePath());
System.setProperty("catalina.base", openejbHome.getAbsolutePath());
System.setProperty("openejb.deploymentId.format", System.getProperty("openejb.deploymentId.format", "{appId}/{ejbJarId}/{ejbName}"));
final Paths paths = new Paths(webapp);
installer = new Installer(paths, true);
if (!configuration.isUseInstallerServlet()) {
installer.installAll();
}
wereOpenejbHomeSet = false;
}
Files.assertDir(openejbHome);
Files.readable(openejbHome);
Files.writable(openejbHome);
Setup.configureServerXml(openejbHome, configuration);
Setup.configureSystemProperties(openejbHome, configuration);
Setup.exportProperties(openejbHome, configuration, true);
final URL logging = Thread.currentThread().getContextClassLoader().getResource("default.remote.logging.properties");
if (logging != null) {
write(logging, new File(openejbHome, "conf" + s + "logging.properties"));
}
if (configuration.isRemoveUnusedWebapps()) {
Setup.removeUselessWebapps(openejbHome, "tomee");
}
if (logger.isLoggable(Level.FINE)) {
Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
for (Map.Entry<Object, Object> entry : map.entrySet()) {
System.out.printf("%s = %s\n", entry.getKey(), entry.getValue());
}
}
Setup.installArquillianBeanDiscoverer(openejbHome);
if (!wereOpenejbHomeSet && configuration.isUseInstallerServlet()) {
// instead of calling the Installer, let's just do like users do
// call the servlet installer instead
final String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort() + "/tomee/installer";
assert installer != null;
installer.addTomEEAdminConfInTomcatUsers(true);
final RemoteServer tmpContainer = new RemoteServer();
tmpContainer.start();
final URL url = new URL(baseUrl);