try {
portletXml = Descriptors.importAs(PortletDescriptor.class).fromStream(
applicationArchive.get("WEB-INF/portlet.xml").getAsset().openStream());
if (null != portletXml) {
PortletArchiveMetadata metadata = new PortletArchiveMetadata();
List<PortletType<PortletDescriptor>> portlets = portletXml.getAllPortlet();
for (PortletType<PortletDescriptor> portlet : portlets) {
metadata.addPortletName(portlet.getPortletName());
}
portletMetadata.set(metadata);
}
return true;
} catch (Exception e) {