text: The OSGi framework lets you build applications composed of multiple modules. The modules must resolve their Java package dependencies for the framework to assemble the modules into a working system. In a perfect world, every Java library would be an OSGi bundle (module), but many libraries aren't. So how do you resolve the packages your OSGi module needs from non-OSGi third party libraries?
  Deploying the module to Liferay's OSGi framework lets you share it on the system. If you find a module for the library you need, deploy it. Then add a compileOnly (Gradle) or <scope>provided</scope> (Maven) dependency for it in your module. When you deploy your module, the OSGi framework wires the dependency module to your module. If there's no OSGi module based on the Java library, go to Step 2.
  Step 2 - Resolve the Java packages privately in your module: You can copy required library packages into your OSGi module or embed them wholesale, if you must. The rest of the tutorial shows you how to do this.
  Note: Liferay's Gradle plugin com.liferay.plugin automates several third party library configuration steps. The plugin is applied to Liferay Workspace Gradle module projects created in Liferay Developer Studio or using Liferay Blade CLI automatically.
  If you use Gradle without the com.liferay.plugin plugin, you'll have to embed the third party libraries wholesale.
  When you depend on a library JAR, much of the time you only need parts of it. Explicitly specifying only the Java packages you need makes your bundle more modular. This also insulates modules that depend on your module from unneeded packages.
  Note: If the library you've added as a dependency in your build.gradle file has transitive dependencies, you can reference them in an -includeresource: instruction by name without having to add them explicitly to the list of dependencies. See how it's used in the Maven section next.
  Lastly, if after embedding a library you get unresolved imports when trying to deploy to Liferay, you may need to blacklist some imports: