[Building Sakai] Deploying an artifact in shared/lib

Matthew Jones matthew at longsight.com
Fri Sep 27 12:28:36 PDT 2013


There was an old post in 2007 (
http://mail-archives.apache.org/mod_mbox/tomcat-users/200708.mbox/%3C46CAF11D.4030706@christopherschultz.net%3E)
based on a blog post (
http://digitalsanctum.com/2007/08/18/20-tips-for-using-tomcat-in-production/)
where the recommendation was to put everything you need for your webapp to
run in it's webapp. This makes it more portable and basically just costs
you a little more permgen and disk space. We've been removing more of these
(mostly the UI frameworks) as different versions of tools may depend on
different versions of spring-mvc or wicket for example. If you have
duplicate jars from an older tool (like a contrib tool someone build) that
used for instance commons coded 1.4, with the same jar in shared it can
potentially cause runtime exceptions that are really troublesome for new
deployers to figure out.

Looking at commons-codec for example in 2.10 trunk this is the count of the
versions that these tools are using. Sure they could all be fixed and
upgraded in core, but contrib is tougher, and someone would have to do that
work to save 46K * 140 files.
      3 commons-codec-1.2.jar
      3 commons-codec-1.3.jar
      2 commons-codec-1.4.jar
    135 commons-codec-1.5.jar

Some things this doesn't work for and have to be in shared, like hibernate,
all of the sakai apis that connect up to the components. If a library was
huge and all over the place, I'd also consider that different, but 5MB
isn't worth the risk.

Anyway, to answer your question, all you should to deploy an artifact to
shared is a property to deploy.target in the pom. You could setup a
separate dummy pom to deploy it like portal (
https://source.sakaiproject.org/svn/portal/trunk/portal-shared-deploy/) or
include it in your regular pom. I believe it deploys all the dependencies
of that project/module.

  <properties>
    <deploy.target>shared</deploy.target>
  </properties>


On Fri, Sep 27, 2013 at 2:45 PM, Joshua Swink <joshua.swink at gmail.com>wrote:

> Let's say I want commons-codec-1.5.jar to go into Tomcat's shared/lib
> directory. What would be the best way to do this? Should I add 'deploy'
> module and use the assembly plugin?
>
> Also, I see commons-codec-1.5.jar duplicated many times under the webapps
> directory. Seems like it would be a good candidate to be standardized and
> have its version referenced in the master pom.
>
> Josh
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130927/249f9156/attachment.html 


More information about the sakai-dev mailing list