Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This article applies to Geronimo 2.1.

...

A feature that helps with running multiple servers, whether or not they are sharing a repository, is the configuration substitution property facility. config.xml can have expressions of the form

...

...

etc. These expressions are evaluated with jexl using values set from:

...

First, we consider the single server instance case, and just add a second repository. Say we want to leave Geronimo in its repository, but add a second repository to deploy our applications. Adding a second repository is pretty easy.

...

The detailed steps to install a server specific repository as specified next can be bypassed by utilizing an easy to install Geronimo Plugin for Geronimo 2.1+. In fact, the plan displayed below was generated by building that plugin. Reference the specific steps to gain a deeper understanding or if you need to follow the manual steps to customize the result. However, if this general plan is sufficient for you just simply install the Geronimo Server Specific Repository Plugin (org.apache.geronimo.plugins/server-repo/1.0/car) and pick up the discussion on using the new repository.

  1. Create a plan (say server-repo.xml) for your repository module. xmlsolid.1. If you would rather use this plan with Geronimo 2.1 you must update the j2ee-system dependency version. Code BlockxmlxmlborderStylesolidtitleserver-repo.xml <?xml version="1.0" encoding="UTF-8"?> <!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--> <!--$Rev: 663365 665870 $ $Date: 2008-06-04 09 16:1410:04 16 -0400 (WedMon, 04 09 Jun 2008) $--> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <environment> <moduleId> > <!--Repository--> <environment> <moduleId> <groupId>org.apache.geronimo.plugins</groupId> <artifactId>server-repo</artifactId> <version>1.0</version> <type>car</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.framework</groupId> <artifactId>j2ee-system</artifactId> <version>2.1.1</version> <type>car</type> </dependency> </dependencies> <hidden-classes/> <non-overridable-classes/> </environment> <!--Repository--> <gbean name="ServerRepo" class="org.apache.geronimo.system.repository.Maven2Repository"> <attribute name="root">var/repository/</attribute> <attribute name="resolveToServer">true</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>ServerRepo</name> </reference> </gbean> </module>
  2. Create the repository's root directory via mkdir <geronimo_home>/var/repository#* The directory is specified by the root attribute of the Maven2Repository GBean, repository/ in the above example. It is a path relative to the base server directory <geronimo_home>.
    • The resolveToServer attribute specifies the repository's location.
      • true means this path is relative to baseServer, which is useful with multiple server instances.
      • false means this path is relative to the base directory <geronimo_home>.
  3. Deploy the repository module by deploying server-repo.xml via deploy deploy server-repo.xml.

    Tip

    The deploy command is the script <geronimo_home>/bin/deploy.{bat,sh}, depending on your operating system. It is invoked by typing simply deploy either from the <geronimo_home>/bin directory, or by having that directory in your path.

Using the new repository

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:

...

The use of environment variables is recommended for command-line use. For example, set REPO2= org.apache.geronimo.plugins/server-repo/1.0/car?ServiceModule=org.apache.geronimo.plugins/server-repo/1.0/car,j2eeType=ConfigurationStore,name=Local2.

...

Note the | character separates the repository name from the module name. The " quotes are used around the entire parameter to escape this special character from command shell interpretation.

...

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!

...

What's lacking is console support for multiple repositories, and support for hot deployment and plugins.

...

...

An interesting wrinkle here is in what repository is the new repository deployed? It's clear that the second repository (say server-repo.xml above) will be deployed in the first repository. Thus, making this first repository read-only will not work for dynamically adding repositories. Perhaps a second repository is added to contain these server-unique repositories. The second repository must be shared and read-write, so it does not fit nicely in the use case. (sad)