Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

You can use a reference class to the gbean org.apache.geronimo.system.sharedlib.SharedLib so that you can use shared libraries in your applications. By default, you may put all your libraries and classes files under <Geronimo_HOME>/var/shared directory, then add a dependency to deployment plan of your application as followed.

Code Block
xml
xml
borderStylesolidxml
...
<environment>
    <dependencies>
        <dependency>
            <groupId>org.apache.geronimo.configs</groupId>
            <artifactId>sharedlib</artifactId>
        </dependency>
    </dependencies>
 ...
</environment>
...

You can also specify another directory rather than the default <Geronimo_HOME>/var/shared directory for libraries sharing. Use the following code snippet in your deployment plan when referring to a relative path:

Code Block
xml
xml
borderStylesolid
titleusing relative pathsxml
...
 <gbean name="SharedLib1" class="org.apache.geronimo.system.sharedlib.SharedLib">
   <attribute name="baseDir">var/shared</attribute>
        <attribute name="classesDirs">classes</attribute>
        <attribute name="libDirs">lib</attribute>
        <reference name="ServerInfo">
            <name>ServerInfo</name>
        </reference>
   </gbean>
  ...

or the following code snippet when referring to an absolute path:

Code Block
xml
xml
borderStylesolid
titleusing absolute pathsxml
...
 <gbean name="SharedLib1" class="org.apache.geronimo.system.sharedlib.SharedLib">
   <attribute name="baseDir">c:/mySharedLib</attribute>
        <attribute name="classesDirs">classes</attribute>
        <attribute name="libDirs">lib</attribute>
        <reference name="ServerInfo">
            <name>ServerInfo</name>
        </reference>
   </gbean>
  ...