@Argument(multiValued = true)
List<String> pluginArtifacts;
@Override
protected Object doExecute() throws Exception {
ServerConnection connection = connect();
CommandListConfigurations command = new CommandListConfigurations();
String repo = null;
PluginListType plugins = null;
if (mavenRepoURL != null) {
plugins = command.getPluginCategories(mavenRepoURL, (GeronimoDeploymentManager) connection
.getDeploymentManager(), this);
repo = mavenRepoURL;
} else {
println("Listing configurations from Geronimo server");
repo = (String) session.get("PluginRepository");
if (refreshRepo || repo == null) {
session.put("AvailablePlugins", null);
repo = command.getRepository(this, (GeronimoDeploymentManager) connection
.getDeploymentManager());
session.put("PluginRepository", repo);
}
plugins = (PluginListType) session.get("AvailablePlugins");
if (refreshList || plugins == null) {
plugins = command.getPluginCategories(repo, (GeronimoDeploymentManager) connection
.getDeploymentManager(), this);
session.put("AvailablePlugins", plugins);
}
}
if (plugins != null) {
if (pluginArtifacts != null) {
command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(), pluginArtifacts,
plugins, repo, this, connection);
} else {
PluginListType pluginsToInstall = command.getInstallList(plugins, this, repo);
if (pluginsToInstall != null) {
command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(),
pluginsToInstall, repo, this, connection);
}
}
}