...
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.
...
INLINE
Wiki Markup |
---|
{scrollbar} |
excerpt
The advantage of having multiple repositories is that they can reside on different server instances.
...
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:
Table of Contents |
---|
As an alternative to the steps in this section, a server-repo plugin is available to perform this configuration for you. Visit the Samples section for further details.
Creating multiple repositories on a single server instance
...
- 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:Code Block title solidrepo2.xmlborderStyle solid <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"> <environment> <moduleId> <groupId>org.example.configs</groupId> <artifactId>myrepo</artifactId> <version>2.2</version> <type>car</type> </moduleId> <dependencies> <dependency> <groupId>org.apache.geronimo.framework</groupId> <artifactId>j2ee-system</artifactId> <type>car</type> </dependency> </dependencies> <hidden-classes/> <non-overridable-classes/> </environment> <gbean name="Repo2" class="org.apache.geronimo.system.repository.Maven2Repository"> <attribute name="root">repo2/</attribute> <attribute name="resolveToServer">false</attribute> <reference name="ServerInfo"> <name>ServerInfo</name> </reference> </gbean> <gbean name="Local2" class="org.apache.geronimo.system.configuration.RepositoryConfigurationStore"> <reference name="Repository"> <name>Repo2</name> </reference> </gbean> </module> - Deploy the
repo2.xml
from the command prompt:
deploy(.bat|.sh) deploy <Geronimo<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|.sh) list-targets
, and you can see the following information:No Format Available Targets: org.apache.geronimo.framework/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.framework/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2 - Update the
etc/org.ops4j.pax.url.mvn.cfg
file, add the new second repository to theorg.ops4j.pax.url.mvn.defaultRepositories
property
The propertyorg.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:Code Block file:${org.apache.geronimo.server.dir}/repo2@snapshots And the resulting property would be set to something that looks like this:Code Block org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/repository@snapshots,file:${org.apache.geronimo.server.dir}/repo2@snapshots The first defined repository is the default and primary GERONIMO_HOME/repository, the second one is the new GERONIMO_HOME/repo2 repository just created.
...
- .
...
See GERONIMO-6284 for details.
Deploying an application to the repository
...
- List the targets on the current server via the command:
deploy(.bat|.sh) list-targets
, and you can see the following information:No Format Available Targets: org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2 org.apache.geronimo.configs/j2ee-system/2.2/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.2/car,j2eeType=ConfigurationStore,name=Local Set the environment variable REPO2:
On a Windows system set REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2 On a non-Windows system export REPO2=org.example.configs/myrepo/2.2/car?ServiceModule=org.example.configs/myrepo/2.2/car,j2eeType=ConfigurationStore,name=Local2 - Deploy the application to the repository repo2, named as "Local2" with the following deploy (.bat or .sh) command:
- On a Windows system:
deploy.bat deploy --targets
...
- Local2 <SAMPLE_HOME>/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war
- 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:
...
Deployed
...
org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
...
@
...
/jsp-examples
- Access the application at http:// < host > : < port > /jsp-examples.
- To undeploy the application from the repository repo2, run the following deploy (.bat
...
- ) command:
- On a Windows system:
deploy.bat undeploy "
...
- org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"
- On a non-Windows system:
deploy
...
- undeploy "
...
- org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war"
Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war unloaded. Module org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war uninstalled. Undeployed org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
Creating multiple repositories on multiple server instances
...
- 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:
- using non-Windows:
...
export GERONIMO_SERVER=server2
deploy -port instance2_RMI_port deploy $GERONIMO_HOME/server2/repo22/repo22.xml
- using Windows
set GERONIMO_SERVER "server2"deploy.bat
...
-port instance2_RMI_port deploy
...
%GERONIMO_
...
HOME%/server2/repo22/repo22.xml
You can follow the same steps to create repositories for server instance3.
...
To test the repository that you create, you can deploy a sample application to and undeploying it from the repository.
- Set the environment variable repo22 Note the repository name for the repository repo22 that you have previously created. We'll assume the name is Local22.
- Deploy the application to the repository repo2 repo22 with the following deploy(.bat or .sh) command:
- On a non-Windows system
...
- :
export GERONIMO_SERVER=server2
deploy -port instance2_RMI_port deploy --targets
...
- Local22 <SAMPLE_HOME>/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war
- On a
...
- Windows system:
set GERONIMO_SERVER "server2"
deploy.
...
- bat -port instance2_RMI_port deploy --targets
...
- Local22 <SAMPLE_HOME>/applications/geronimo-jsp-examples/target/geronimo-jsp-examples-2.2.war
- Undeploy the jsp application from repo22 repository with the following command:
- On a non-Windows system
...
- :
export GERONIMO_SERVER=server2
deploy -port instance2_RMI_port undeploy
...
- org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
- On a
...
- Windows system:
set GERONIMO_SERVER "server2"
deploy.
...
- bat -port instance2_RMI_port undeploy
...
- org.apache.geronimo.applications.examples/geronimo-jsp-examples/2.2/war
You can follow the same steps to deploy applications to and undeploy applications from repositories on server instance3.