// FIXME this plugin loading scheme causes classloading issues w/weld because weld cannot load classes
// from its own classloaders before plugins are loaded and pollute the classpath.
// We can work around it by loading weld before we load plugins, then restarting weld, but this is SLOW.
try
{
WeldContainer container = weld.initialize();
manager = container.getBeanManager();
weld.shutdown();
}
catch (Exception e)
{
}
try
{
// TODO verify plugin API versions. only activate compatible plugins.
loadPlugins();
WeldContainer container = weld.initialize();
manager = container.getBeanManager();
}
catch (Throwable e)
{
// Boot up with external plugins disabled.
System.out
.println("Plugin system disabled due to failure while loading one or more plugins; try removing offending plugins with \"forge remove-plugin <TAB>\".");
e.printStackTrace();
Thread.currentThread().setContextClassLoader(mainClassLoader);
initLogging();
WeldContainer container = weld.initialize();
manager = container.getBeanManager();
}
try
{
manager.fireEvent(new PreStartup());
}