list.getDefaultRepository().add("http://www.ibiblio.org/maven2/");
DownloadResults results = installer.install(list, repo.toString(), false, null, null);
if (results.isFailed()) {
throw new ServletException("Unable to install sample application", results.getFailure());
}
ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
for (Artifact artifact: results.getInstalledConfigIDs()) {
if (mgr.isConfiguration(artifact)) {
try {
if (!mgr.isLoaded(artifact)) {
mgr.loadConfiguration(artifact);
}
if (!mgr.isRunning(artifact)) {
mgr.startConfiguration(artifact);
}
} catch (NoSuchConfigException e) {
throw new ServletException("Unable to start sample application", e);
} catch (LifecycleException e) {
throw new ServletException("Unable to start sample application", e);