LPS-48313 Abstract out direct deploy logic to a smaller macrodefs that can be called independently. No logic changes.
LPS-48313 If you're an OSGi module and you have a portlet.xml, then we need to massage your web.xml