File workDir = new File(properties.get("nexus-work")).getCanonicalFile();
mkdir(workDir.toPath());
// lock the work directory
lockFile = new LockFile(new File(workDir, "nexus.lock"));
if (!lockFile.lock()) {
throw new IllegalStateException("Nexus work directory already in use: " + workDir);
}
// are we already running in OSGi or should we embed OSGi?