Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a plan (say repo2.xml) for your repository module.
    Code Block
    xml
    xml
    borderStylesolid
    titlerepo2.xml
    <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
     <environment>
      <moduleId>
       <groupId>org.example.configs</groupId>
        <artifactId>myrepo</artifactId>
        <version>2.0-SNAPSHOT</version>
        <type>car</type>
      </moduleId>
     <dependencies>
      <dependency>
       <groupId>org.apache.geronimo.configs</groupId>
       <artifactId>j2ee-system</artifactId>
       <version>2.0-SNAPSHOT</version>
       <type>car</type>
    </dependency>
     </dependencies>
     <hidden-classes/>
     <non-overridable-classes/>
    </environment>
     <\!--Repository-->
     <gbean name="Repo2" class="org.apache.geronimo.system.repository.Maven2Repository">
       <attribute name="root">repo2/</attribute>
       <reference name="ServerInfo">
        <name>ServerInfo</name>
       </reference>
     </gbean>
    
      <\!--Configuration Store service-->
      <gbean name="Local2" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore">
        <reference name="Repository">
         <name>Repo2</name>
        </reference>
      </gbean>
    </module>
    
  2. Create the repository's root directory. mkdir <geronimo_home>/repo2
    1. The directory is specified by the root attribute of the Maven2Repository GBean, repo2/ in the above example.  It is a path relative to the base directory <geronimo_home>.
    2. A resolveToServer attribute is being added to allow this path to be relative to baseServer, which is useful with multiple server instances.
  3. Deploy the repository module by deploying repo2.xml.

Using the new repository is a little tricky, and is only supported from the command line currently. The essence is to use the --targets option of the deploy command to target your module to deploy in your new repository. First, use the deployer list-targets command to see the repositories.  The target names are long and cumbersome:

>java >((java deployer.jar list-targets}}

{{Available Targets:

 org.example.configs/myrepo/2.0-SNAPSHOT/car?ServiceModule=org.example.configs/myrepo/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local2

 org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local}}
The use of environment variables is recommended for command-line use.  For example, set REPO2= org.example.configs/myrepo/2.0-SNAPSHOT/car?ServiceModule=org.example.configs/myrepo/2.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local2. To deploy to the new repository, use: deploy --targets %REPO2% sample.war deploy list-modules also gives those long target names on each module. However, deploy list-modules %REPO2% gives the accustomed short output. The syntax to undeploy from a repo is: >java deployer.jar undeploy  "%REPO2%|geronimo/jsp-examples/1.1.1/war" If no --targets are given on the deploy command, the module is deployed to all repositories.  This certainly seems undesirable.  If you only want to put the module in one repository, be sure to use the --targets option!

...