legacy-knowledge-base
公開されました Jun. 30, 2025

How to overcome BOMs pointing to wrong JARs?

written-by

Jose L. Bango

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • When compiling our custom code, we encounter issues where our OSGi modules fail to start due to unresolved references to the Liferay packages.
  • For instance, the following error is thrown:
    org.osgi.framework.BundleException: Could not resolve module: my.custom.portlet [1111]_ 
    Unresolved requirement: Import-Package: com.liferay.portal.kernel.exception; version="[13.5.0,14.0.0)"
  • The root cause appears to be that the BOMs for our version point to the wrong JARs.

Environment

  • Liferay Developer Tools

Resolution

  • To prevent such issues, consider utilizing the fat-jar (or mega-jar) as outlined in the Managing the Target Platform article.
  • Using com.liferay.portal.kernel as an example, what you would do to fix the issue is to replace all instances of this:
    group: "com.liferay.portal", name: "com.liferay.portal.kernel"
    And instead use the release.dxp.api megajar dependency:
    group: "com.liferay.portal", name: "release.dxp.api"
    If you already importing release.dxp.api, then remove the com.liferay.portal.kernel dependency,
  • The portal-kernel compiled (portal-kernel.jar) and its source code is available through the BOMs, release.dxp.api-202x.qx.x.jar and release.dxp.api-202x.qx.x-sources.jar, respectively. These BOMs and all other BOMs are downloaded when a Liferay Workspace is built targeting the version 202x.qx.x.

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base