I’m using several jars in my portlets, for instance c3p0. Now I want to avoid to put the jars in every of my portlets lib folders. How can I share one jar file within multiple portlets? And how should I integrate them in the Eclipse IDE? Add an external jar or put them in one dedicated project and include them from there?
Share
Another solution would be to put them under
../liferay-portal-<version>/tomcat-<version>/webapps/ROOT/WEB-INF/libIf you place them here you can add the JAR as a dependency for your portlet in the portlets
liferay-plugin-package.properties(if you’re using Liferay Developer Studio or Liferay IDE then there’s a nice GUI for this).Then on deployment Liferay will copy the required JARS from
ROOT/WEB-INF/libto your portletsWEB-INF/libThis I believe is the Liferay support mechanism for doing it, and doesn’t require a restart because the JARs are copied to the portlets classpath on deployment.