{
RES: for (Resource<?> res : list)
{
try
{
PluginJar jar = new PluginJar(res.getName());
for (PluginJar p : installed)
{
if (p.isSamePlugin(jar))
{
if (p.getVersion() < jar.getVersion())
{
installed.remove(p);
installed.add(jar);
}
continue RES;
}
}
installed.add(jar);
}
catch (IllegalNameException e)
{
untracked.add(res);
}
}
if (!installed.isEmpty())
{
writer.println();
writer.println(ShellColor.RED, "[installed plugins]");
for (PluginJar jar : installed)
{
writer.print(ShellColor.ITALIC, jar.getDependency().getGroupId());
writer.print(" : ");
writer.print(ShellColor.BOLD, jar.getDependency().getArtifactId());
writer.print(" : ");
if (Strings.isNullOrEmpty(jar.getDependency().getVersion()))
{
writer.print(ShellColor.RED, "unversioned");
}
else
{
writer.print(ShellColor.YELLOW, jar.getDependency().getVersion());
}
if (showAll)
{
writer.print(ShellColor.ITALIC,
" - " + environment.getPluginDirectory().getFullyQualifiedName() + "/" + jar.getFullName());
}
writer.println();
}
}