2
votes
Liferay/Tomcat: Where do I put my own selection of spring-framework jars? - Stack Overflow
Asked
Viewed 1k times
2

I want to program against the Spring Portlet MVC framework in liferay running under Tomcat. For each portlet, I can put the spring framework -jars in the WEB-INF/lib directory of that portlet. I prefer to not do this. Seems redundant to me. Instead, can I put the spring framework jars somewhere else to make a single selection of spring jars available to all my future portlets?

To my understanding, these locations are available, but which is "best"?

  • ROOT/WEB-INF/lib/ (this is the dir of the liferay core)
  • tomcat/lib/ext (default location for all web-apps)
  • docroot/WEB-INF/ext-lib/global (in ext folder of of the liferay SDK)
    1

    For Tomcat version of Liferay I would recommend to put the external libraries in tomcat/lib/ext

      1

      tomcat/lib/ext is the place to go.

      Also you should not touch ROOT/WEB-INF/lib directory. This is lib dir of LIferay which is different web application than your portlets.

        0

        Note that it is also possible to have multiple portlets in a single WAR. So if, for some reason, you do not want to add stuff to global libs, you can include all your portlets in a single WAR-file. This way you always have the necessary dependencies available, no matter what Liferay installation is running.

          Your Answer

          By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

          Not the answer you're looking for? Browse other questions tagged or ask your own question.

           
          3

          3 Answers

          1
          votes

          For Tomcat version of Liferay I would recommend to put the external libraries in tomcat/lib/ext

          1
          votes

          tomcat/lib/ext is the place to go.

          Also you should not touch ROOT/WEB-INF/lib directory. This is lib dir of LIferay which is different web application than your portlets.

          0
          votes

          Note that it is also possible to have multiple portlets in a single WAR. So if, for some reason, you do not want to add stuff to global libs, you can include all your portlets in a single WAR-file. This way you always have the necessary dependencies available, no matter what Liferay installation is running.