Blogs
Find all the packages that are exported by the Liferay portal
I'm recently faced with a challenge of understanding all the packages that are exported by the Liferay portal. Liferay comes with a lot of inbuilt OSGI modules and it is quite difficult to find all the packages exported by all of the modules.
Here's a little background about my challenge:
I never knew that the package "com.fasterxml.jackson.core" is being exported by default by the Liferay portal. So I included and resolved them in my project using the available resources and blogs:
https://liferay.dev/blogs/-/blogs/osgi-module-dependencies
https://portal.liferay.dev/docs/7-0/reference/-/knowledge_base/r/third-party-packages-portal-exports
But chances are very likely that it would be nice to know all the packages exported by the Liferay portal. I don't want to include `Jackson-core` and `Jackson-annotations` to the classpath of my module, when they were already being exported by Liferay.
Right now, there is no solid way of knowing all the packages that are being exported by Liferay. Here's my workaround. Hope it helps out you too.
Workaround:
1) Install org.apache.felix.webconsole-4.3.4.jar to the OSGI container. You can download it here:
(Copy this jar into the LIFERAY_HOME/deploy directory)
2) Go to localhost:8080/o/system/console (username and password being `admin`, `admin`). Click the tab `bundles`.
3) Go to developer tools (I used Google-chrome). Open console, paste the following snippet and hit enter (jQuery is being loaded automatically, you can always double check it in the network tab):
4) Press `End` button of your keyboard. It should take you to the bottom of the screen. Scroll up and down for a couple of times, so that jQuery has worked on clicking all the elements in the table. It should take a while (It's a 1000+ rows). Copy and paste the contents of your browser in a text-pad of your choice. (I'm using visual-studio code, with language-mode `log`). Moving forward, you can use this as a reference, if you have a question about including a package from third-party library on your modules classpath (Make sure that the package you are including is not in the Export-Package of any of the modules in the text-file you copied). I'll post my version of text file here in a while.

