Lps 40606 master

Jira ticket: https://issues.liferay.com/browse/LPS-40606
Alternate solution to: https://github.com/noellekimiko/liferay-plugins/pull/6

* Same fix as in [6.2.x](https://github.com/noellekimiko/liferay-plugins/commit/7788a56e178100906070fab192eaf9b5c3c20110) and also the fixes in liferay-portal-ee
* However, this one is not tested -- the portlet will not deploy even without these changes