...
- set the
org.apache.geronimo.server.name
system property to the instance name before you start the server.- Use the syntax
-Dorg.apache.geronimo.server.name=foo
to name your instancefoo
.
- There are two ways to do this:
- Add this to your
GERONIMO_OPTS
environment variable, or
- Add this to your
- Pass it on the java command-line invocation of the server.
- The server's var directory will then be in <geronimo_home>/foo.
org.apache.geronimo.server.name
may be any pathname relative to (descending from) <geronimo_home>.
- The
org.apache.geronimo.server.dir
system property may also be used, and it overridesorg.apache.geronimo.server.name
.
- Use
-
org.apache.geronimo.server.name
to specify an absolute path, which need not be relative to <geronimo_home>. Otherwise, the two system properties behave the same.
- Use the syntax
mkdir foo
- Copy var to foo.
- Start the server.
Multiple Repositories
...
- Create a plan (say repo2.xml) for your repository module.
Code Block xml xml borderStyle solid title repo2.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>
- Create the repository's root directory.
mkdir <geronimo_home>/repo2
- 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>. - A resolveToServer attribute is being added to allow this path to be relative to baseServer, which is useful with multiple server instances.
- The directory is specified by the root attribute of the Maven2Repository GBean,
- Deploy the repository module by deploying
repo2.xml
.
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:
...
Note |
---|
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. |
Warning |
---|
If no |
Multiple Server Instances, each with its own repository(ies)
In the case of multiple server instances, the a separate path may be given for the the Maven2Repository root attribute for each server. To make this easier, This might be done with config.xml
overrides for each server instance. A better solution is to add a resolveToServer
attribute is added to this GBean, so that the root
attribute may be set to repository
, and it will thus be unique for each server instance with no changes required for each instance, say in config.xml
. Each server instance would then have a repository located at <geronimo_home>/<instance_name>/repository
.
Warning |
---|
What's lacking is console support for multiple repositories, and support for hot deployment and plugins. |
...