How to manually remove / delete a portlet

問題

  • How can I completely delete a portlet so that I can redeploy an older version?
  • When I uninstall a portlet from the App Manager, it's only Blacklisted and not uninstalled.
  • How do I remove a custom module in Liferay?

環境

  • DXP 7.0 DXP 7.1 DXP 7.2

解決

  • To completely uninstall a portlet, simply remove its .jar from the file system e.g., remove the file from ${liferay.home}/osgi/modules

  • Wider explanation by example:

    A.) When a module is deployed, in this case by placing it into the ${liferay.home}/deploy folder, we can see the STARTED message in the log

    INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:271] Processing my-example-portlet.jar
    ................ STARTED my-example-portlet.jar


    B.) We can also view the deployment in the UI under Control Panel > Apps > App Manager

    port1.png

    C.) Clicking the 3-ellipses gives us the options to Deactivate or Uninstall

    Selecting Uninstall we are then prompted to confirm by Pressing OK

    In the logging we see that the portlet has now been Blacklisted and STOPPED:

    INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration)][BundleBlacklist:188] Stopping blacklisted bundle my-example-portlet.jar

    INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration)][BundleStartStopLogger:49] STOPPED my-example-portlet.jar


    D.) If we navigate to Control Panel > Configuration > System Settings > Module Container > Bundle Blacklist - we find the portlet blacklist entry:

    port2.png

    If we delete the my-example-portlet entry from Blacklist Bundle Symbolic Names and press Update, this will reinstall and start up the portlet again. 

    INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration)][BundleBlacklist:120] Reinstalling bundle my-example-portlet.jar

    INFO [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.liferay.portal.bundle.blacklist.internal.BundleBlacklistConfiguration)][BundleStartStopLogger:46] STARTED my-example-portlet.jar

    This happens as my-example-portlet.jar still exists under ${liferay.home}/osgi/modules

    Screen_Shot_2020-11-11_at_14.07.48.png

    Moreover, even if we delete the contents of ${liferay.home}/osgi/state , the portlet remains STOPPED while still present in the above location.


    Summary
    Remove the .jar file from ${liferay.home}/osgi/modules to uninstall a portlet.

 

追加情報

 

この記事は役に立ちましたか?
0人中0人がこの記事が役に立ったと言っています