users@glassfish.java.net

Re: make GF consider also JAR files in /WEB-INF/lib/myFolder

From: Sanjeeb Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 06 Oct 2010 17:02:33 +0530

There is a portable solution to your problem. Create an empty jar in
WEB-INF/lib/ with a manifest entry called *Class-Path* having a value of
space delimited list of relative path names of the jars in the other
directory.

e.g., if your war looks like this:

WEB-INF/lib/myFolder/
                                      a.jar
                                      b.jar
                                      c.jar
then make it look like this:

WEB-INF/lib/extra.jar
                      myFolder/
                                      a.jar
                                      b.jar
                                      c.jar,

where extra.jar is an empty jar with MANIFEST.MF looking like this:

Class-Path: myFolder/a.jar myFolder/b.jar myFolder/c.jar

This is called bundled optional packaging and is discussed in greater
details in chapter #8 of Java EE Platform Spec. You should be able to
automate the creation of this manifest file in your build environment.

Thanks,
Sahoo

On Tuesday 05 October 2010 03:00 PM, glassfish_at_javadesktop.org wrote:
> It is a real problem.
>
> We need a way so our .WAR could use another deployed file containing all the JARs.
> Putting manually all the jars in the java runtime or in the glassfish/lib directory is a very bad solution, and hard to manage.
>
> It is very surprising that glassfish didn't address this issue.
> [Message sent by forum member 'nadavb']
>
> http://forums.java.net/jive/thread.jspa?messageID=484354
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>