The --libraries deploy time attribute for an application can be used to specify runtime dependencies of an application. When a relative path is specified, (only the jar name), Application Server attempts to find the specified library in domain-dir/lib/applibs.
To make a library available to the whole domain, you could place the JAR file in domain-dir/lib or domain-dir/lib/classes. (For more information, see Using the Common Class Loader in Sun GlassFish Enterprise Server 2.1 Developer’s Guide. ) This is usually the case for JDBC drivers and other utility libraries that are shared by all applications in the domain.
For cluster-wide or stand alone server wide use, copy the jars into the domain-dir/domain1/config/xyz-config/lib directory. Next, add the jars in classpath-suffix or classpath-prefix element of xyz-config. This will synchronize the jars for all server instances using xyz-config.
domains/domain1/lib - domain wide scope, common class loader, adds the jars automatically.
domains/domain1/config/cluster1, config/lib - config wide, update classpath-prefix or classpath-suffix.
domains/domain1/lib/applibs - application scope, added to application class loader automatically
domains/domain1/config/cluster1, config/lib/ext - adds to http://java.sun.com/j2se/1.5.0/docs/guide/extensions/extensions.html automatically.