Regarding both Geronimo javaee6 and minimal release bundles. Full support for multiple repositories was completed in GERONIMO-6270 and its sub-tasks. This support is available in the latest snapshots after March 1, 2012, and will be in the 3.0-beta-2 standard release. This documents how to setup multiple repositories after applying the changes from GERONIMO-6270.

For prior releases, this document can still be followed if the org.ops4j.pax.url.mvn.defaultRepositories property is set properly, described in this document.

The advantage of having multiple repositories is that they can reside on different server instances. You can create multiple repositories on different server instances, deploy a single repository on a single server instance, and deploy applications on multiple repositories on a single server instance.

For multiple instance support within a single Geronimo installation, it is recommended that each instance have its own local repository for deploying to (i.e. GERONIMO_SERVER/repository). The primary shared repository (GERONIMO_HOME/repository) in a multiple instance configuration should remain read-only.

This topic includes the following information:

Creating multiple repositories on a single server instance

You can create multiple repositories on Geronimo. You can add a second repository to deploy your applications and leave Geronimo in its default repository.

Creating a repository besides the default repository

To add a second repository besides the default repository, take the following steps:

Start Geronimo.

Create a directory repo2 under <geronimo_home>, for example, <geronimo_home>/repo2.

Create a file repo2.xml under the <geronimo_home>/repo2 directory, for example:

repo2.xml

Deploy the repo2.xml from the command prompt:deploy(.bat) 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) list-targets, and you can see the following information:

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:

And the resulting property would be set to something that looks like this:

The first defined repository is the default and primary GERONIMO_HOME/repository, the second one is the new GERONIMO_HOME/repo2 repository just created.

Deploying an application to the repository

Here is an example of deploying a sample jsp application to the repository repo2.

List the targets on the current server via the command: deploy(.bat) list-targets, and you can see the following information:

On a non-Windows system:deploy deploy --targets Local2 <SAMPLE_HOME>/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war
where <SAMPLE_HOME> is the directory of your samples. Then, the jsp example is deployed to the new repository repo2. The following message is displayed:

Creating multiple repositories on multiple server instances

Create several server instances, and start the server instances. For information about creating server instances, see Running multiple Geronimo instances. Then you need to create several repositories on these server instances. You can test the repositories by deploying an application to these server instances and undeploying the application from these server instances.

Creating a repository for server instance2

After you create more than one server instance, you can create repositories and deploy the repositories to different server instances. For information about how to create and deploy a repository on a server instance, see the following example that creates repo22 and deploys it on server2:

Create a directory repo22 under <geronimo_home>/server2, for example, <geronimo_home>/server2/repo22.

Create a file repo22.xml under the <geronimo_home>/server2/repo22 directory. For detailed information about the file, see creating multiple repositories.

Deploy the repo22.xml by running the following command from the command prompt: