In order to configure GEP to publish Maven dependencies as shared library, you will need to install Maven Integration for Eclipse. To install m2eclipse plugin, follow the instructions at given at http://m2eclipse.codehaus.org/. The configuration steps are illustrated using a web application and adding a dependency on commons-dbcp library.

  1. Create a HelloWorld Dynamic Web project as given in Web applications.
  2. Enable Maven 2 support for the web-app project as given below:
  3. To add a dependency on commons-dbcp library:
  4. To use a class from commons-dbcp library inside web-app's index.jsp:
  5. Enable in-place shared library support in Server editor as given below:
  6. To add a dependency on org.apache.geronimo.configs/sharedlib//car in geronimo-web.xml:
  7. To run the HelloWorld application:

Use the steps below to verify that maven dependency is indeed added as a shared library:

  1. Verify that a file HelloWorld.eclipse.jar is created under <geronimo_home>/var/shared/lib.
  2. Verify that the Manifest.mf file in HelloWorld.eclipse.jar contains the following:
    Manifest-Version: 1.0
    Class-Path: file:/E:/m2repo/commons-pool/commons-pool/1.3/commons-pool
     -1.3.jar file:/E:/m2repo/commons-dbcp/commons-dbcp/1.3-SNAPSHOT/commo
     ns-dbcp-1.3-SNAPSHOT.jar
    

    The file path used in the manifest Class-Path may differ based on the location of your maven2 repository.