use of org.bimserver.plugins.MavenPluginRepository in project BIMserver by opensourceBIM.
the class LocalDevPluginLoader method createPluginManager.
public static PluginManager createPluginManager(Path home, Path[] pluginDirectories) throws PluginException {
if (!Files.exists(home)) {
try {
Files.createDirectories(home);
} catch (IOException e) {
e.printStackTrace();
}
}
MavenPluginRepository mavenPluginRepository = new MavenPluginRepository();
PluginManager pluginManager = new PluginManager(home.resolve("tmp"), System.getProperty("java.class.path"), null, null, null, null);
PluginBundleManager pluginBundleManager = new PluginBundleManager(pluginManager, mavenPluginRepository, home.resolve("plugins"));
loadPlugins(pluginBundleManager, pluginDirectories);
pluginManager.initAllLoadedPlugins();
return pluginManager;
}
use of org.bimserver.plugins.MavenPluginRepository in project BIMserver by opensourceBIM.
the class LocalDevSetup method setupJson.
/**
* @param address
* @return
*/
@SuppressWarnings("resource")
public static final BimServerClientInterface setupJson(String address) {
try {
Path home = Paths.get("home");
if (!Files.isDirectory(home)) {
Files.createDirectory(home);
}
Path tmp = home.resolve("tmp");
if (!Files.isDirectory(tmp)) {
Files.createDirectory(tmp);
}
MavenPluginRepository mavenPluginRepository = new MavenPluginRepository();
PluginManager pluginManager = new PluginManager(tmp, System.getProperty("java.class.path"), null, null, null, null);
PluginBundleManager pluginBundleManager = new PluginBundleManager(pluginManager, mavenPluginRepository, home.resolve("plugins"));
pluginBundleManager.loadAllPluginsFromEclipseWorkspace(Paths.get("../"), true);
MetaDataManager metaDataManager = new MetaDataManager(tmp);
pluginManager.setMetaDataManager(metaDataManager);
metaDataManager.init(false);
pluginManager.initAllLoadedPlugins();
BimServerClientFactory factory = new JsonBimServerClientFactory(metaDataManager, address);
return factory.create(new UsernamePasswordAuthenticationInfo("admin@bimserver.org", "admin"));
} catch (PluginException e) {
LOGGER.error("", e);
} catch (ServiceException e) {
LOGGER.error("", e);
} catch (ChannelConnectionException e) {
LOGGER.error("", e);
} catch (IOException e) {
LOGGER.error("", e);
} catch (BimServerClientException e) {
LOGGER.error("", e);
}
return null;
}
use of org.bimserver.plugins.MavenPluginRepository in project BIMserver by opensourceBIM.
the class LocalDevSetup method setupPluginManager.
public static final PluginManagerInterface setupPluginManager(String[] args) {
try {
Path home = Paths.get("home");
if (!Files.exists(home)) {
Files.createDirectory(home);
}
Path tmp = home.resolve("tmp");
if (!Files.exists(tmp)) {
Files.createDirectories(tmp);
}
MavenPluginRepository mavenPluginRepository = new MavenPluginRepository();
PluginManager pluginManager = new PluginManager(tmp, System.getProperty("java.class.path"), null, null, null, null);
MetaDataManager metaDataManager = new MetaDataManager(tmp);
pluginManager.setMetaDataManager(metaDataManager);
PluginBundleManager pluginBundleManager = new PluginBundleManager(pluginManager, mavenPluginRepository, home.resolve("plugins"));
loadPlugins(pluginBundleManager, Paths.get(".."), new OptionsParser(args).getPluginDirectories());
metaDataManager.init(false);
pluginManager.initAllLoadedPlugins();
return pluginManager;
} catch (PluginException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
Aggregations