...
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.
- Create a plan (say repo2server-repo.xml) for your repository module. Note: This plan is the same plan that is leveraged in the server-repo Geronimo plugin for Geronimo 2.1.1. To use this plan with Geronimo 2.1 you must update the j2ee-system dependency listed below to reference version 2.1.
Code Block xml xml borderStyle solid title repo2server-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 $ $Date: 2008-06-04 16:14:04 -0400 (Wed, 04 Jun 2008) $--> <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <environment> <moduleId> <groupId>org.exampleapache.geronimo.configs<plugins</groupId> <artifactId>myrepo<<artifactId>server-repo</artifactId> <version>2<version>1.1<0</version> <type>car</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.configs<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="Repo2ServerRepo" class="org.apache.geronimo.system.repository.Maven2Repository"> <attribute name="root">repo2s>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>Repo2<<name>ServerRepo</name> </reference> </gbean> </module>
- Create the repository's root directory via
mkdir <geronimo_home>/repo2svar/repository
#* The directory is specified by theroot
attribute of the Maven2Repository GBean,repo2srepository/
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>.
- The
- Deploy the repository module by deploying
repo2server-repo.xml
viadeploy deploy repo2server-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 simplydeploy
either from the <geronimo_home>/bin directory, or by having that directory in your path.
...
deploy list-targets
Available Targets:
org.exampleapache.geronimo.configsplugins/myreposerver-repo/21.1-SNAPSHOT0/car?ServiceModule=org.exampleapache.geronimo.configsplugins/myreposerver-repo/21.1-SNAPSHOT0/car,j2eeType=ConfigurationStore,name=Local2
org.apache.geronimo.configsframework/j2ee-system/2.1-SNAPSHOT.1/car?ServiceModule=org.apache.geronimo.configsframework/j2ee-system/2.1.1-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local
Tip |
---|
The use of environment variables is recommended for command-line use. For example, |
...
deploy list-modules
also gives those long target names for each reporepository, followed by the usual short names of each module deployed in the repo.
deploy list-modules %REPO2%
gives the accustomed short output for the target reporepository.
The syntax to undeploy from a repo repository is: deploy undeploy "%REPO2%|geronimo/jsp-examples/1.1.1/war"
.
...
Note |
---|
An interesting wrinkle here is in what repository is the new repository deployed? It's clear that the second repository (say |