<?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>Share a jar between portlets</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=1125352" />
  <subtitle>Share a jar between portlets</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=1125352</id>
  <updated>2026-04-06T06:10:35Z</updated>
  <dc:date>2026-04-06T06:10:35Z</dc:date>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6361727" />
    <author>
      <name>Matus Ferko</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=6361727</id>
    <updated>2010-11-05T15:46:41Z</updated>
    <published>2010-11-05T15:46:41Z</published>
    <summary type="html">This is one important question.&lt;br /&gt; One way is to create every portlet under one master portlet directory and deploy it as single .war file.&lt;br /&gt;&lt;br /&gt;I wonder if idea of deploying these common jar files through Ext plugin is reasonable. It contains ext-lib\global directory and when I put some jar file in it it&amp;#39;s copied to lib/ext during deployment.&lt;br /&gt;That way the classes are available for every portlet.</summary>
    <dc:creator>Matus Ferko</dc:creator>
    <dc:date>2010-11-05T15:46:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1142543" />
    <author>
      <name>Vihang Pathak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1142543</id>
    <updated>2008-08-04T07:16:44Z</updated>
    <published>2008-08-04T07:16:44Z</published>
    <summary type="html">There are three ways to do that:&lt;br /&gt;All three ways will require one master-portlet.xml which will contain references to all portlets that are in the single war.&lt;br /&gt;&lt;br /&gt;1. Move all your portlets which are currently under plugins directory under the master-portlet. And run the build script&lt;br /&gt;2. Keep the portlets where they are and in the master-portlet build.xml, build the other two portlets and copy the jars into the WEB-INF/lib of the master-portlet.war, thereby maintaining the package structure.&lt;br /&gt;&lt;br /&gt;3.  Make the jars manually(not the war) of the classes in other portlets, and package them in the master war.</summary>
    <dc:creator>Vihang Pathak</dc:creator>
    <dc:date>2008-08-04T07:16:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1142448" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1142448</id>
    <updated>2008-08-04T06:59:22Z</updated>
    <published>2008-08-04T06:59:22Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Vihang Pathak:&lt;/div&gt;&lt;blockquote&gt;Hence, the option of bundling all portlets in a single war and putting the common jar in the WEB-INF/lib of that war, seems to be the way to go as of now.&lt;/blockquote&gt;&lt;br /&gt;And how do you package all portlets in a single war ? Because all my portlets are in their own folder: &amp;lt;plug_in&amp;gt;/portlets/portlet_one-portlet,  &amp;lt;plug_in&amp;gt;/portlets/portlet_two-portlet,...&lt;br /&gt;And when you have the war file, you put the jars manually ?&lt;br /&gt;&lt;br /&gt;Thanks or your help !</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-08-04T06:59:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1139582" />
    <author>
      <name>Vihang Pathak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1139582</id>
    <updated>2008-08-02T05:50:10Z</updated>
    <published>2008-08-02T05:50:10Z</published>
    <summary type="html">If we go through the build*.xmls in plugins folder we find that Liferay/plugin/lib folder will be used only while compiling the plugins directory or any of the included portlets/themes/web&lt;br /&gt;&lt;br /&gt;These jars which are in plugins/lib are either already present in Liferay-Porta/WEB-INF/lib or they are used for executing ant targets etc.&lt;br /&gt;&lt;br /&gt;So, if I understand correctly , the jars from plugins/lib will not be copied to the portlet/web-inf/lib.&lt;br /&gt;&lt;br /&gt;Apart from the methods mentioned in this thread, another way can be to put your jar as part of Liferay-Portal/WEB-INF/lib and then in build.{username}.properties  modify the required.portal.jars directory&lt;br /&gt;&lt;br /&gt;I wont recommend this option though. The common jars that need to be put need  to have a compelling reason to be in Liferay-Portal/WEB-INF/lib, if they are going to be used by a large number of portlets.&lt;br /&gt;&lt;br /&gt;Hence, the option of bundling all portlets in a single war and putting the common jar in the WEB-INF/lib of that war, seems to be the way to go as of now.</summary>
    <dc:creator>Vihang Pathak</dc:creator>
    <dc:date>2008-08-02T05:50:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1137130" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1137130</id>
    <updated>2008-08-01T13:42:34Z</updated>
    <published>2008-08-01T13:42:34Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Mohamed Ali:&lt;/div&gt;&lt;blockquote&gt;Hi Jean, follow this steps,&lt;br /&gt;&lt;br /&gt;1. create jar of your common source file and copy to the root context.&lt;br /&gt;2. create context.xml in docroot/META-INF/context.xml&lt;br /&gt;3. add this content in context.xml&lt;br /&gt;     &amp;lt;Context&amp;gt;&lt;br /&gt;	     &amp;lt;Loader &lt;br /&gt;		loaderClass=&amp;#34;com.liferay.support.tomcat.loader.PortalClassLoader&amp;#34;&lt;br /&gt;	      /&amp;gt;&lt;br /&gt;      &amp;lt;/Context&amp;gt;&lt;br /&gt;&lt;br /&gt;This will access your jar globally in the server.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;It works. But this solution is not really convenient. If I want to share my portlets with other people, it&amp;#39;s easier to give them just war files. With this solution, I must give: the portlet + a jar and explain them where to put all these files.&lt;br /&gt;&lt;br /&gt;Thanks for your help</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-08-01T13:42:34Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1137025" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1137025</id>
    <updated>2008-08-01T13:22:24Z</updated>
    <published>2008-08-01T13:22:24Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Ganesh Ram:&lt;/div&gt;&lt;blockquote&gt;If you put your jars in  &amp;lt;liferay-plugins&amp;gt;\trunk\lib, then when u deploy the plugin portlet, the build takes care to put the jars in ur portlets web-inf/lib.&lt;/blockquote&gt;&lt;br /&gt;I don&amp;#39;t have &amp;lt;liferay-plugins&amp;gt;\trunk\lib. I try to create it. But when I build my portlets, the jar is not put in web-inf/lib.</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-08-01T13:22:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1126011" />
    <author>
      <name>Mohamed Ali</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1126011</id>
    <updated>2008-07-30T09:44:17Z</updated>
    <published>2008-07-30T09:44:17Z</published>
    <summary type="html">Hi Jean, follow this steps,&lt;br /&gt;&lt;br /&gt;1. create jar of your common source file and copy to the root context.&lt;br /&gt;2. create context.xml in docroot/META-INF/context.xml&lt;br /&gt;3. add this content in context.xml&lt;br /&gt;     &amp;lt;Context&amp;gt;&lt;br /&gt;	     &amp;lt;Loader &lt;br /&gt;		loaderClass=&amp;#34;com.liferay.support.tomcat.loader.PortalClassLoader&amp;#34;&lt;br /&gt;	      /&amp;gt;&lt;br /&gt;      &amp;lt;/Context&amp;gt;&lt;br /&gt;&lt;br /&gt;This will access your jar globally in the server.</summary>
    <dc:creator>Mohamed Ali</dc:creator>
    <dc:date>2008-07-30T09:44:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125997" />
    <author>
      <name>ora egozi barzilai</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125997</id>
    <updated>2008-07-30T09:42:49Z</updated>
    <published>2008-07-30T09:42:49Z</published>
    <summary type="html">Here is another suggestion which I used for a demo.&lt;br /&gt;I bundled my portlets into Liferay (all in the same war), by adding them to the web-content\html\portlet\MyPortlet1.&lt;br /&gt;&lt;br /&gt;I think Liferay also has an extension folder (still in the same war) you can put them which is obviously better than putting them together with Liferay&amp;#39;s portlets like I did.&lt;br /&gt;&lt;br /&gt;HTH&lt;br /&gt;Ora</summary>
    <dc:creator>ora egozi barzilai</dc:creator>
    <dc:date>2008-07-30T09:42:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125801" />
    <author>
      <name>Ganesh Ram</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125801</id>
    <updated>2008-07-30T09:02:44Z</updated>
    <published>2008-07-30T09:02:44Z</published>
    <summary type="html">If you put your jars in  &amp;lt;liferay-plugins&amp;gt;\trunk\lib, then when u deploy the plugin portlet, the build takes care to put the jars in ur portlets web-inf/lib.&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;Ganesh</summary>
    <dc:creator>Ganesh Ram</dc:creator>
    <dc:date>2008-07-30T09:02:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125618" />
    <author>
      <name>Lari Tuominen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125618</id>
    <updated>2008-07-30T08:09:59Z</updated>
    <published>2008-07-30T08:09:59Z</published>
    <summary type="html">Hi, I would also like to know if there is an easy way to achieve this.&lt;br /&gt;&lt;br /&gt;Currently we are modifying the build scripts - for instance target compile on build-common-plugin.xml (fileset dir=&amp;#34;......&amp;#34; includes=&amp;#34;.....&amp;#34;)&lt;br /&gt;&lt;br /&gt;- Lari</summary>
    <dc:creator>Lari Tuominen</dc:creator>
    <dc:date>2008-07-30T08:09:59Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125571" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125571</id>
    <updated>2008-07-30T07:57:20Z</updated>
    <published>2008-07-30T07:57:20Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Manish Kumar Gupta:&lt;/div&gt;&lt;blockquote&gt;I am not much aware of portlet development using plugin environment, but can you bundle your all the portlets in a single war and deploy it?&lt;/blockquote&gt;&lt;br /&gt;I don&amp;#39;t know. Right now, each portlet is in its own war.</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-07-30T07:57:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125532" />
    <author>
      <name>Manish Kumar Gupta</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125532</id>
    <updated>2008-07-30T07:39:53Z</updated>
    <published>2008-07-30T07:39:53Z</published>
    <summary type="html">I am not much aware of portlet development using plugin environment, but can you bundle your all the portlets in a single war and deploy it?</summary>
    <dc:creator>Manish Kumar Gupta</dc:creator>
    <dc:date>2008-07-30T07:39:53Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125481" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125481</id>
    <updated>2008-07-30T07:26:53Z</updated>
    <published>2008-07-30T07:26:53Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Ganesh Ram:&lt;/div&gt;&lt;blockquote&gt;This  &lt;a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1091443"&gt;chain&lt;/a&gt; might help u.&lt;/blockquote&gt;&lt;br /&gt;It&amp;#39;s not a jar from Liferay, It&amp;#39;s a personnal jar with my own classes. If a add &amp;#34;portal.dependency.jars: MyPersonnalJar.jar&amp;#34; in liferay-plugin-package.properties. Where I put MyPersonnalJar.jar ?&lt;br /&gt;&lt;br /&gt;Thanks for your help !</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-07-30T07:26:53Z</dc:date>
  </entry>
  <entry>
    <title>RE: Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125461" />
    <author>
      <name>Ganesh Ram</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125461</id>
    <updated>2008-07-30T07:21:31Z</updated>
    <published>2008-07-30T07:21:31Z</published>
    <summary type="html">This  &lt;a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1091443"&gt;chain&lt;/a&gt; might help u.</summary>
    <dc:creator>Ganesh Ram</dc:creator>
    <dc:date>2008-07-30T07:21:31Z</dc:date>
  </entry>
  <entry>
    <title>Share a jar between portlets</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125351" />
    <author>
      <name>Jean Andre Latour</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1125351</id>
    <updated>2008-07-30T06:51:15Z</updated>
    <published>2008-07-30T06:51:15Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;I developed some struts-portlet in the plugin environment. My portlets need some java classes to work and they all need the same classes. For the moment, I put the source files of my classes in WEB-INF/src in each of my portlets. It&amp;#39;s not really convenient and when I edit one of my class, I have to update the source files in all my portlet.&lt;br /&gt;So, I want to create a jar with my classes and make it accessible to all my portlets. Is it possible ? How can I do that ?&lt;br /&gt;I remember you that I develop plugin portlets.&lt;br /&gt;&lt;br /&gt;Thanks for your help !</summary>
    <dc:creator>Jean Andre Latour</dc:creator>
    <dc:date>2008-07-30T06:51:15Z</dc:date>
  </entry>
</feed>
