This article is about how to use the Geronimo Eclipse Plugin(GEP) to convert Applications into Geronimo plugins and install them back into the server.
We use Apache Geronimo v2.2 and an existing sample application throughout the tutorial. See Stateless Session Bean for development and deployment of the application.
Creating Geronimo plugins
In order to convert applications into Geronimo plugins, the Geronimo Server must be installed and started. Note that only a Geronimo configuration with file type .car can be exported from a server.
And you must have installed the sample application on the running server.
Creating plugins using GEP
Once done, follow the steps below to export Geronimo plugins using GEP.
- Double-click the Geronimo server that you defined will display the Server Editor in the main window, and then select Plugin page.
- Click Convert Apps to Plugins button will show a wizard named as Plugin Manager.
- Enter or create a directory name, and then select create Geronimo plugin radio button. The directory that you defined is a temporary repository to store exported plugins, and you can make any manual updates there if necessary.
- The next page of the wizard contains a drop-down list of all the modules that can be converted into Geronimo plugins on the running server. For example, select the console.dbpool/jdbc_userds/1.0/car from the list.
- Select your application objects (one at a time) and click Next will bring up pages that allow you to change the attributes in
geronimo-plugin.xmlfile before saving. All the fields on the next two pages are data that will be saved with the plugin and will help with installation.
A human-readable name that will be displayed for this plugin.
The globally unique ID for this plugin. This value is defined during installation of the application to be exported. This value also defines the version number for the plugin.
- Download Repos
A list of repositories to check for any dependencies that need to be downloaded. This should be a list of one URL per line, with values such as http://geronimoplugins.com/repository/ and http://www.ibiblio.org/maven2/. Note that the repository this plugin is deployed to should typically be the first one listed.
The category this plugin falls into. Plugins in the same category will be listed together. If this plugin is intended to be listed on geronimoplugins.com then you should use one of the category names there if any of them fit. Otherwise, you can select this freely, or according to the categories acceptable to the repository where you plan to post this.
A description of this plugin. You should use plain text only, with blank lines to separate paragraphs.
- Plugin URL
A URL to get more information about the plugin (for example, the plugin home page).
The author of the plugin, which may be a person, company, open source community and so on.
- Geronimo Versions
An optional list of Geronimo versions supported by this plugin. If no values are listed, the plugin can be installed in any version of Geronimo. Otherwise, you can install this plugin in one acceptable Geronimo version.
- JVM Versions
An optional list of JVM version prefixes supported by this plugin. If no values are listed, the plugin can be installed in Geronimo running in any version of the JVM. Otherwise, you can install this plugin in one acceptable JVM version.
A list of Geronimo configurations that this plugin depends on. These dependencies will be downloaded automatically when this plugin is installed. Normally you shouldn't change this list. However, you can move entries from the dependency list to the prerequisite list if the user must install the dependency manually before installing the plugin (for example, for a database pool where a plugin does not know what server to connect to). Each entry in this list should use the Unique ID format like the one that is used for this plugin above. You may remove the version number if you want the plugin to work with any version of the dependency, though that may be risky. Each value should be on a separate line.
A list of module IDs that this plugin replaces. Those plugins or modules will be removed when this one is installed. That may include previous versions of this plugin if you want installing it to "upgrade" rather than just offering an additional alternative. This should be a list with one module ID per line.
- The next page has 2 tables. You can update the data in both the License table and Prerequisite table using the Add, Edit, and Remove buttons.
The name of the license that this plugin is covered by. Ideally, it would be prefixed by the class of license, like "BSD – (name)" or "GPL – (name)". Specify whether the license is an OSI-approved open source license. See http://www.opensource.org/licenses/index.php for more information about open source licenses.
The module IDs of prerequisites for this plugin. These are modules that must be present in the server before the plugin is installed. They may be something like a specific web container for a web application (
geronimo/jetty/1.0/car) or something like a database pool or security realm that the user must install because the plugin author can't create a value that will be valid in the destination server. You may want to leave out as many segments of the module ID as possible in order to accommodate more users. For example, use
- Click Next on the page, and the plugin is saved together with a
geronimo-plugin.xmlfile. The wizard goes back to the first page for user to export another plugin.
- (Optional)To export multiple plugins, repeat the steps above. For example, export ApplicationClient and StatelessSessionEJB plugins using the same procedure by selecting them from the list.
- (Optional) Click Cancel to quit the wizard.
The above process creates a maven-like repository with the name specified in Local Plugin Repository field at the first page of the wizard. A
geronimo-plugin.xml file is created for each plugin under its
/META-INF directory. The top directory of the repository includes a
geronimo-plugins.xml file which keeps track of all the plugins that have been created. The values in these files came from fields in the last two pages of the wizard.
Installing Geronimo Plugins
If you intend to install plugins into the same server that is used to export the plugins, you have to remove the projects and relevant resources from the server firstly.
- To remove the projects, use Add and Remove item on the right-click list of the server in Eclipse;
- To remove the resources, the database pool in this tutorial, you can use undeploy command as followed;
Installing the plugins
To install the plugins back into a Geronimo server, follow the steps below:
- Select Plugin page and then click Convert Apps to Plugins button.
- Enter the name of the plugin repository, and then select install Geronimo plugins radio button.
- Click Next to select the Geronimo plugins that you want to install on the server.
- If Installable is
false, the plugin cannot be selected. The most common reason that a plugin cannot be installed is that the version of this plugin is already installed on the server or its prerequisites are not met.
- If Installable is
- Click Next to install all selected plugins. After that, a confirmation page comes up showing that the plugins have been installed successfully.