Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updating this doc per the fixes and findings in GERONIMO-6284

...

  1. Start Geronimo.
  2. Create a directory repo2 under <geronimo_home>, for example, <geronimo_home>/repo2.
  3. Create a file repo2.xml under the <geronimo_home>/repo2 directory, for example:
    Code Block
    titlerepo2.xml
    borderStylesolid
    <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
     <environment>
      <moduleId>
       <groupId>org.example.configs</groupId>
        <artifactId>myrepo</artifactId>
        <version>2.2</version>
        <type>car</type>
      </moduleId>
      <dependencies>
       <dependency>
        <groupId>org.apache.geronimo.framework</groupId>
        <artifactId>j2ee-system</artifactId>
        <type>car</type>
       </dependency>
      </dependencies>
      <hidden-classes/>
      <non-overridable-classes/>
     </environment>
     <gbean name="Repo2" class="org.apache.geronimo.system.repository.Maven2Repository">
       <attribute name="root">repo2/</attribute>
       <attribute name="resolveToServer">false</attribute>
       <reference name="ServerInfo">
        <name>ServerInfo</name>
       </reference>
     </gbean>
     <gbean name="Local2" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
      <reference name="Repository">
       <name>Repo2</name>
      </reference>
     </gbean>
    </module>
    
  4. Deploy the repo2.xml from the command prompt:
    deploy(.bat|.sh) deploy <Geronimo_HOME>/repo2/repo2.xml
    .
    To verify that the repository is successfully deployed, you can list the targets on the current server with the command:
    deploy(.bat|.sh) list-targets, and you can see the following information:
    No Format
    
    Available Targets:
      org.apache.geronimo.framework/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.framework/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local
      org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2
    
  5. Update the etc/org.ops4j.pax.url.mvn.cfg file, add the new second repository to the org.ops4j.pax.url.mvn.defaultRepositories property
    The property org.ops4j.pax.url.mvn.defaultRepositories maintains a comma-delimited list of repositories that are used by the run-time server.
    The format is: file: < /absolute/path/to/repo2 > @snapshots
    And if a variable it used, the new repository just deployed would be defined as:
    Code Block
    file:${org.apache.geronimo.server.dir}/repo2@snapshots
    And the resulting property would be set to something that looks like this:
    Code Block
    org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/repository@snapshots,file:${org.apache.geronimo.server.dir}/repo2@snapshots
    The first defined repository is the default and primary GERONIMO_HOME/repository, the second one is the new repo2 repository just created.
Note

In Geronimo 3.0, there is a minor bug that exists when creating additional repositories for Geronimo instances. The files GERONIMO_HOME/var/config/config.xml and GERONIMO_HOME/var/config/config-substitutions.properties must exist even though they are never used, otherwise Geronimo will fail complaining that they do not exist. Simply create these files, or copy them from GERONIMO_SERVER/var/config/... to work around this issue.

See GERONIMO-6284 for details.

Deploying an application to the repository

...