Hi guys!
I’d like to have your opinions on pros and cons of these two ways to share JARs across multiple projects in
Tomcat
with
Liferay
.
1 - Vaadin 6 standard way
Insert all the utility JARs that I need for all projects into Liferay libs (ROOT/WEB-INF/lib), and take a copy of everyone in each project using the
liferay-plugin-package.properties
, like it is for vaadin.jar
2 - customizing Class Loader
Remove the vaadin.jar from Liferay lib and all liferay-plugin-package.properties, taking only one centralized copy into the Tomcat Common Libraries, among with all the utility JARs which must be reachable to all project.
Create a new Class which extends ApplicationPortlet2 and overrides the getCLassLoader method in this way:
protected ClassLoader getClassLoader() throws ServletException {
return Thread.currentThread().getContextClassLoader();
}
Replacing the standard
portlet-class
in the
portlet.xml
files with this new Class
In each way portlets look to work fine, as long I have tested, but which solution do you think could be the best and why?
Thanks in advance for your opinions.