if(commandArgs.getArgs().length == 1) {
repo = commandArgs.getArgs()[0];
} else {
repo = getRepository(out, new BufferedReader(new InputStreamReader(System.in)), mgr);
}
PluginList data;
URL repository;
try {
repository = new URL(repo);
data = mgr.listPlugins(repository, null, null);
} catch (IOException e) {
throw new DeploymentException("Unable to list configurations", e);
} catch (FailedLoginException e) {
throw new DeploymentException("Invalid login for Maven repository '"+repo+"'", e);
}
if (data == null) {
out.println();
out.println("No plugins were returned from this site.");
return;
}
Map categories = new HashMap();
List available = new ArrayList();
for (int i = 0; i < data.getPlugins().length; i++) {
PluginMetadata metadata = data.getPlugins()[i];
List list = (List) categories.get(metadata.getCategory());
if(list == null) {
list = new ArrayList();
categories.put(metadata.getCategory(), list);
}