UIContext uiContext = context.getUIContext();
Project project = Projects.getSelectedProject(projectFactory, uiContext.getSelection());
if (project != null && project.hasFacet(PackagingFacet.class))
{
PackagingFacet facet = project.getFacet(PackagingFacet.class);
BuildResult buildResult = facet.getBuildResult();
if (!buildResult.isSuccess())
{
UIOutput output = uiContext.getProvider().getOutput();
PrintStream err = output.err();
output.error(err, String.format("Project '%s' has errors", project.getRoot()));
for (BuildMessage message : buildResult.getMessages())
{
switch (message.getSeverity())
{
case ERROR:
output.error(err, message.getMessage());