<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Including Third Party jars as a Separate OSGI Module</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117898506" />
  <subtitle>Including Third Party jars as a Separate OSGI Module</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117898506</id>
  <updated>2026-04-04T23:25:09Z</updated>
  <dc:date>2026-04-04T23:25:09Z</dc:date>
  <entry>
    <title>RE: Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117921682" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117921682</id>
    <updated>2019-11-28T11:20:43Z</updated>
    <published>2019-11-28T11:20:43Z</published>
    <summary type="html">Hi David, &lt;br /&gt;Thanks for your inputs. We have tried to deploy the war files in liferay dxp and found that deployment time is more due to external third party dependencies and war file size. &lt;br /&gt;Anyway the modules works fine without any issue after deployment.&lt;br /&gt;To reduce the deployment time, we have planned of moving the third party dependencies as a separate module and we were also able to achieve to some extent with few small third party jars like jsoup with/without transitive dependencies. &lt;br /&gt;Also we have tried of using some liferay  provided modules by checking com.liferay.portal.bootstrap.jar\META-INF\system.packages.extra.mf file and able to achieve to some extent.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Aravinth</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2019-11-28T11:20:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117915580" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117915580</id>
    <updated>2019-11-27T17:22:03Z</updated>
    <published>2019-11-27T17:22:03Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Aravinth Kumar:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;We have kept Apache Service Mix/Eclipse Orbit as last option as we have many third party jars and its a migration project from 6.2 Spring MVC. Apache Service Mix works perfectly.&lt;br /&gt;&lt;br /&gt;I followed the below way.&lt;br /&gt;&lt;br /&gt;1.Created a OSGI module &amp;#34;Parent&amp;#34; and include all the jars. Used Include-Resource: in the bnd.bnd file. &lt;br /&gt;2.Generated jar contains all the classes of the third party jar.&lt;br /&gt;3. Included that jar in Child Spring MVC portlet as with provided scope but getting &amp;#34;java.lang.NoClassDefFoundError&amp;#34; in runtime.&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Eeek! Run away, run away!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Seriously though, what you are doing is a nightmare waiting to happen. If your stuff is working as a portlet war in 6.2, just keep it as a portlet war for 7.x. Spring, service mix, orbit, etc are all going to introduce some heavy dependencies and transient dependencies that will be difficult to manage from a build perspective but also a catastrophe waiting to happen with runtime class loader conflicts.&lt;br /&gt;&lt;br /&gt;Keeping them as a portlet war will help to contain the dependencies and not bleed them into the OSGi container where they can really muck up the works.&lt;br /&gt;&lt;br /&gt;You save little if anything trying to turn them into globally available dependency packages and risk disruption of the portal by conflicting with packages and libraries it provides and/or uses.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-11-27T17:22:03Z</dc:date>
  </entry>
  <entry>
    <title>RE: Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117913282" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117913282</id>
    <updated>2019-11-27T15:41:45Z</updated>
    <published>2019-11-27T15:41:45Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Aravinth Kumar:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;1.Created a OSGI module &amp;#34;Parent&amp;#34; and include all the jars. Used Include-Resource: in the bnd.bnd file. &lt;br /&gt;2.Generated jar contains all the classes of the third party jar.&lt;br /&gt;3. Included that jar in Child Spring MVC portlet as with provided scope but getting &amp;#34;java.lang.NoClassDefFoundError&amp;#34; in runtime.&lt;br /&gt;&lt;/blockquote&gt;Not knowing what &amp;#34;all the jars&amp;#34; are and for which class you get the &amp;#34;NoClassDefFoundError&amp;#34;, you&amp;#39;re most likely missing either the class that the error message is complaining about, or one of its dependencies: The class might not load if it references another missing class, e.g. in one of its fields.</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-11-27T15:41:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117911855" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117911855</id>
    <updated>2019-11-27T15:20:27Z</updated>
    <published>2019-11-27T15:20:27Z</published>
    <summary type="html">Hi Olaf,&lt;br /&gt;Thank you for the response.  We have kept Apache Service Mix/Eclipse Orbit as last option as we have many third party jars and its a migration project from 6.2 Spring MVC. Apache Service Mix works perfectly.&lt;br /&gt;&lt;br /&gt;I followed the below way.&lt;br /&gt;&lt;br /&gt;1.Created a OSGI module &amp;#34;Parent&amp;#34; and include all the jars. Used Include-Resource: in the bnd.bnd file. &lt;br /&gt;2.Generated jar contains all the classes of the third party jar.&lt;br /&gt;3. Included that jar in Child Spring MVC portlet as with provided scope but getting &amp;#34;java.lang.NoClassDefFoundError&amp;#34; in runtime.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Aravinth</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2019-11-27T15:20:27Z</dc:date>
  </entry>
  <entry>
    <title>RE: Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117904761" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117904761</id>
    <updated>2019-11-27T11:48:20Z</updated>
    <published>2019-11-27T11:48:20Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Aravinth Kumar:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;I m using liferay 7.2 DXP. I have more third party dependencies like jsoup, apache cxf used in multiple modules.  As of now we are directly including it in the pom.xml of each module. In future, we are planning to create a separate osgi module which consists of all third party dependencies and include them in all other normal modules (It has both OSGI Module and Spring MVC Portlet).I m trying to follow the link, &lt;a href="https://liferay.dev/blogs/-/blogs/osgi-module-dependencies"&gt;https://liferay.dev/blogs/-/blogs/osgi-module-dependencies&lt;/a&gt; to make the module as uber module but getting Caused by: java.lang.NoClassDefFoundError error in runtime.  Please guide me if I need to do anything else. &lt;br /&gt;&lt;/blockquote&gt;You&amp;#39;re not winning a lot by combining them all into a single bundle. Check if some of them are bundles already and then just deploy them independently. You might also find OSGi-ified dependencies in the &lt;a href="http://servicemix.apache.org/"&gt;servicemix&lt;/a&gt; repositories.&lt;br /&gt;Other than that, reading the description above to the letter: You&amp;#39;re doing &lt;em&gt;something&lt;/em&gt;, see an error and wonder if you need to do &lt;em&gt;something else&lt;/em&gt;. (Sorry for the sneaky italics) - Based on the description, I&amp;#39;d say: Yes, you&amp;#39;ll need to do &lt;em&gt;something else&lt;/em&gt;, but as we don&amp;#39;t know &lt;em&gt;what&lt;/em&gt; you&amp;#39;re doing, it&amp;#39;s hard to say what to do &lt;em&gt;differently&lt;/em&gt;.</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2019-11-27T11:48:20Z</dc:date>
  </entry>
  <entry>
    <title>Including Third Party jars as a Separate OSGI Module</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117898505" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117898505</id>
    <updated>2019-11-26T14:59:41Z</updated>
    <published>2019-11-26T14:59:41Z</published>
    <summary type="html">Hi All,&lt;br /&gt;I m using liferay 7.2 DXP. I have more third party dependencies like jsoup, apache cxf used in multiple modules.  As of now we are directly including it in the pom.xml of each module. In future, we are planning to create a separate osgi module which consists of all third party dependencies and include them in all other normal modules (It has both OSGI Module and Spring MVC Portlet).I m trying to follow the link, &lt;a href="https://liferay.dev/blogs/-/blogs/osgi-module-dependencies"&gt;https://liferay.dev/blogs/-/blogs/osgi-module-dependencies&lt;/a&gt; to make the module as uber module but getting Caused by: java.lang.NoClassDefFoundError error in runtime.  Please guide me if I need to do anything else. &lt;br /&gt;Thanks in Advance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,Aravinth</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2019-11-26T14:59:41Z</dc:date>
  </entry>
</feed>
