Wiki Markup |
---|
{scrollbar} |
...
Creating a plugin
If the appropriate admin console plugin is installed (and your geronimo server includes web app support) you can install plugins from a plugin repository. After selecting the "plugins" page from the navigation menu select the plugin repository you want, such as your local maven repository if you have been building your own plugins. Next you see a list of available plugins from the repository. Select multiple plugins using the checkboxes or a single plugin as a link, and on the next page you will see more information on the plugins. On your approval the plugins will be downloaded and installed.
Alternatively you can use gshell to install plugins using the deploy/list-plugins command. This can be run with a command line or interactively. Interactively you can select the plugin repository to use (if more than one is known), and then select the plugins to install. Again, they will be downloaded and installed. An example of command line usage will be seen as followed:
You can install a plugin into an existing server in different ways:
- GShell deploy/list-plugins command
- Geronimo administrative console
- Using maven and the geronimo-maven-plugin
You can also install a plugin into a new server assembly using the car-maven-plugin.
Note that in all cases the dependency system assure that if you install a plugin, everything needed to run the plugin will also be installed. For instance if you install a Java EE application plugin such as one of the samples into the framework server, openejb, openjpa, the transaction manager and connector framework and the appropriate web container will also be installed as dependencies.
Creating a plugin
- You can create a plugin as part of a maven build using the car-maven-plugin.
- You can create a plugin "virtually" by installing a deployed application from a running geronimo server acting as a plugin repository.
- You can create a plugin using the Geronimo administrative console to create or edit the plugin metadata.
By far the easiest way to build a Geronimo plugin is with maven using the car-maven-plugin to build a module. Any such module will include a geronimo-plugin.xml descriptor with at least minimal information. When possible, such as the description and license, this information is taken from the pom itself. Normally you will build the dependency list from the modules dependencies which are constructed from the maven dependencies plus whatever additional dependencies the deployers determine are needed. For instance an ejb application will have the openejb plugin added as a dependency by the openejb deployer. If necessary you can specify the dependencies for both the module and plugin descriptor explicitly in the car-maven-plugin configuration.
Here's an example of a car-maven-plugin configuration using maven dependencies and configuring most of the additional information possible:
- You can create a plugin as part of a maven build using the car-maven-plugin.
- You can create a plugin "virtually" by installing a deployed application from a running geronimo server acting as a plugin repository.
- You can create a plugin using the Geronimo administrative console to create or edit the plugin metadata.
By far the easiest way to build a Geronimo plugin is with maven using the car-maven-plugin to build a module. Any such module will include a geronimo-plugin.xml descriptor with at least minimal information. When possible, such as the description and license, this information is taken from the pom itself. Normally you will build the dependency list from the modules dependencies which are constructed from the maven dependencies plus whatever additional dependencies the deployers determine are needed. For instance an ejb application will have the openejb plugin added as a dependency by the openejb deployer. If necessary you can specify the dependencies for both the module and plugin descriptor explicitly in the car-maven-plugin configuration.
Here's an example of a car-maven-plugin configuration using maven dependencies and configuring most of the additional information possible:
Code Block | ||||
---|---|---|---|---|
| ||||
<plugin>
<groupId>org.apache.geronimo.buildsupport</groupId>
<artifactId>car-maven-plugin</artifactId>
<configuration>
<useMavenDependencies>
<value>true</value>
<includeVersion>true</includeVersion>
</useMavenDependencies>
<category>Tomcat</category>
<instance>
<plugin-artifact>
<copy-file relative-to="server" dest-dir="var/catalina">tomcat-base/</copy-file>
| ||||
Code Block | ||||
xml | xml | <plugin> <groupId>org.apache.geronimo.buildsupport</groupId><config-xml-content> <artifactId>car-maven-plugin</artifactId> <configuration> <!-- To disable accesslogging uncomment the following lines <useMavenDependencies> <gbean name="TomcatEngine"> <value>true</value> <includeVersion>true</includeVersion> <reference name="TomcatValveChain" /> </useMavenDependencies> <category>Tomcat<</category>gbean> <instance> <gbean name="AccessLogValve" load="false"></gbean> <plugin-artifact> --> <copy-file relative-to="server" dest-dir="var/catalina">tomcat-base/</copy-file> <gbean name="TomcatWebConnector"> <config-xml-content> <attribute <!-- To disable accesslogging uncomment the following lines name="host">${ServerHostname}</attribute> <attribute <gbean namename="TomcatEngine">port">${HTTPPort + PortOffset}</attribute> <reference<attribute name="TomcatValveChainredirectPort">${HTTPSPort + PortOffset}</>attribute> </gbean> <attribute name="maxHttpHeaderSize">8192</attribute> <gbean <attribute name="AccessLogValve" load="false"></gbean>maxThreads">150</attribute> --> <attribute name="minSpareThreads">25</attribute> <gbean <attribute name="TomcatWebConnectormaxSpareThreads">>75</attribute> <attribute name="host">${ServerHostname}<enableLookups">false</attribute> <attribute name="port">${HTTPPort + PortOffset}<acceptCount">100</attribute> <attribute name="redirectPortconnectionTimeout">${HTTPSPort + PortOffsetWebConnectorConTimeout}</attribute> <attribute name="maxHttpHeaderSizedisableUploadTimeout">8192<>true</attribute> </gbean> <attribute name="maxThreads">150</attribute> <attribute <gbean name="minSpareThreadsTomcatAJPConnector">25</attribute>> <attribute name="maxSpareThreads">75<host">${ServerHostname}</attribute> <attribute name="enableLookups">false<port">${AJPPort + PortOffset}</attribute> <attribute name="acceptCount">100<redirectPort">${HTTPSPort + PortOffset}</attribute> <attribute name="connectionTimeout">${WebConnectorConTimeout}</attribute>minSpareThreads">25</attribute> <attribute name="disableUploadTimeoutmaxSpareThreads">true<>75</attribute> </gbean> <attribute name="enableLookups">false</attribute> <gbean name="TomcatAJPConnector"> </gbean> <attribute<gbean name="host">${ServerHostname}</attribute>TomcatWebSSLConnector"> <attribute name="porthost">${AJPPort + PortOffsetServerHostname}</attribute> <attribute name="redirectPortport">${HTTPSPort + PortOffset}</attribute> <attribute name="minSpareThreadsmaxHttpHeaderSize">25<>8192</attribute> <attribute name="maxSpareThreadsmaxThreads">75<>150</attribute> <attribute name="enableLookupsminSpareThreads">false<>25</attribute> </gbean> <attribute name="maxSpareThreads">75</attribute> <gbean<attribute name="TomcatWebSSLConnectorenableLookups">>false</attribute> <attribute name="host">${ServerHostname}<acceptCount">100</attribute> <attribute name="port">${HTTPSPort + PortOffset}<disableUploadTimeout">false</attribute> <attribute name="maxHttpHeaderSizeclientAuth">8192<>false</attribute> <attribute name="maxThreadsalgorithm">150<>Default</attribute> <attribute name="minSpareThreadssslProtocol">25<>TLS</attribute> <attribute name="maxSpareThreadskeystoreFile">75</>var/security/keystores/geronimo-default</attribute> <attribute name="enableLookupskeystorePass">false<>secret</attribute> <attribute name="acceptCountkeystoreType">100<>JKS</attribute> <attribute name="disableUploadTimeout">false</attribute></gbean> <gbean <attribute name="clientAuthTomcatHost">false</attribute>> <attribute name="algorithminitParams">Default</attribute>> <attribute name="sslProtocol">TLS</attribute> ${ServerHostname} <attribute name="keystoreFile">var/security/keystores/geronimo-default</attribute> appBase= <attribute name="keystorePass">secret</attribute>workDir=work <attribute name="keystoreType">JKS<</attribute> </gbean> <gbean name="TomcatHost"></config-xml-content> <attribute name="initParams"><config-substitution key="HTTPPort">8080</config-substitution> name=${ServerHostname}<config-substitution key="AJPPort">8009</config-substitution> <config-substitution key="HTTPSPort">8443</config-substitution> appBase= <config-substitution key="ServerHostname">0.0.0.0</config-substitution> workDir=work <config-substitution key="WebConnectorConTimeout">20000</config-substitution> </attribute><config-substitution key="webcontainer">TomcatWebContainer</config-substitution> </gbean><config-substitution key="webcontainerName">tomcat6</config-substitution> </configplugin-xml-content>artifact> <config-substitution key="HTTPPort">8080</config-substitution></instance> </configuration> <config-substitution key="AJPPort">8009</config-substitution> <config-substitution key="HTTPSPort">8443</config-substitution> <config-substitution key="ServerHostname">0.0.0.0</config-substitution> <config-substitution key="WebConnectorConTimeout">20000</config-substitution> <config-substitution key="webcontainer">TomcatWebContainer</config-substitution> <config-substitution key="webcontainerName">tomcat6</config-substitution> </plugin-artifact> </instance> </configuration> </plugin> |
As you use maven to build plugins, a geronimo-plugins.xml plugin catalog is automatically maintained in your local maven repository. You can force this to be rebuilt by running
Code Block |
---|
mvn org.apache.geronimo.buildsupport:car-maven-plugin:create-pluginlist
|
This might be necessary if you prune your maven repository and remove plugins listed in the catalog.
Alternatively, you can construct the geronimo-plugin.xml file by hand and include it in a deployed module in a geronimo server.
The admin console also allows limited editing of geronimo-plugin.xml files but editing the information about how the plugin fits into the server is not yet supported.
Assembling a server using maven.
The easiest way to assemble a server is to use maven and the car-maven-plugin. The dependencies from your pom will be installed in your server, and if they are plugins they will be installed as modules with all dependencies and stuff unpacked and metadata installed into the correct files. Here's a simple example assembling a server that supports Roller and includes the basic admin console.
...
</plugin>
|
As you use maven to build plugins, a geronimo-plugins.xml plugin catalog is automatically maintained in your local maven repository. You can force this to be rebuilt by running
Code Block |
---|
mvn org.apache.geronimo.buildsupport:car-maven-plugin:create-pluginlist
|
This might be necessary if you prune your maven repository and remove plugins listed in the catalog.
Alternatively, you can construct the geronimo-plugin.xml file by hand and include it in a deployed module in a geronimo server.
The admin console also allows limited editing of geronimo-plugin.xml files but editing the information about how the plugin fits into the server is not yet supported.
Assembling a server using maven.
The easiest way to assemble a server is to use maven and the car-maven-plugin. The dependencies from your pom will be installed in your server, and if they are plugins they will be installed as modules with all dependencies and stuff unpacked and metadata installed into the correct files. Here's a simple example assembling a server that supports Roller and includes the basic admin console.
Wiki Markup |
---|
{snippet:url=geronimo/plugins/roller/trunk/geronimo-jetty-roller/pom.xml|lang=xml} |
Installing a plugin
If the appropriate admin console plugin is installed (and your geronimo server includes web app support) you can install plugins from a plugin repository. After selecting the "plugins" page from the navigation menu select the plugin repository you want, such as your local maven repository if you have been building your own plugins. Next you see a list of available plugins from the repository. Select multiple plugins using the checkboxes or a single plugin as a link, and on the next page you will see more information on the plugins. On your approval the plugins will be downloaded and installed.
Alternatively you can use gshell to install plugins using the deploy/list-plugins command. This can be run with a command line or interactively. Interactively you can select the plugin repository to use (if more than one is known), and then select the plugins to install. Again, they will be downloaded and installed. An example of command line usage will be seen as followed:
You can install a plugin into an existing server in different ways:
- GShell deploy/list-plugins command
- Geronimo administrative console
- Using maven and the geronimo-maven-plugin
You can also install a plugin into a new server assembly using the car-maven-plugin.
Note that in all cases the dependency system assure that if you install a plugin, everything needed to run the plugin will also be installed. For instance if you install a Java EE application plugin such as one of the samples into the framework server, openejb, openjpa, the transaction manager and connector framework and the appropriate web container will also be installed as dependencies.
Updating a plugin
At times, you may need to upgrade a plugin or jar version, for instance if a new version of a dependency is released but you cannot rerelease all the artifacts that depend on it. Here are some methods to upgrade jar versions.
...