------ Server Goals Usage :: Geronimo Plugin for Maven 2 ------ ------ $Rev$ $Date$ ~~ ~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ~~ Server Goals Usage * Assembly Artifact Configuration Before the plugin can start or stop a server, it needs to know about the assembly (or assemblies) which it will install. This example shows one assembly, which will be used to install unless the <<>> parameter has been set (see below section on ). <> Archive files <> be a <<>> files (or be in the same format, like a <<>>). +----------+ org.apache.geronimo.plugins geronimo-maven-plugin org.apache.geronimo.assemblies geronimo-jetty-j2ee ${pom.version} bin zip +----------+ Multiple assemblies may be specified. Each must have a unique id, and either <<>> or <<>> must be configured to inform the plugin which assembly to use. +----------+ org.apache.geronimo.plugins geronimo-maven-plugin jetty org.apache.geronimo.assemblies geronimo-jetty-j2ee ${pom.version} bin zip jetty-minimal org.apache.geronimo.assemblies geronimo-jetty-minimal ${pom.version} bin zip tomcat org.apache.geronimo.assemblies geronimo-tomcat-j2ee ${pom.version} bin zip tomcat-minimal org.apache.geronimo.assemblies geronimo-tomcat-minimal ${pom.version} bin zip jetty +----------+ * Starting Geronimo Server Once you have configured an assembly (or assemblies with a default), then you can simply start the server. The assembly archive will be installed if it does not already exist, or if the plugin detects that the current archive is newer than the last installation. +----------+ mvn geronimo:start +----------+ If you have a pre-existing assembly installed and you want to use that, you can set <<>> this will bypass any installation logic completely. +----------+ mvn geronimo:start -DgeronimoHome=/path/to/assembly +----------+ Some additional flags may be passed in to alter the startup behavior. For example to enable verbose mode: +----------+ mvn geronimo:start -Dverbose=true +----------+ Optional JVM options and/or system properties can be set by configuring a set of options and selecting the options to be enabled. +----------+ org.apache.geronimo.plugins geronimo-maven-plugin debug other foo bar +----------+ Option sets may be selected by configuring the <<>> parameter with a comma seperated list of <<>> ids. To enable a set of options to be enabled by default, then configure an <<>> with the id of <<>> and omit the <<>> parameter. +----------+ mvn geronimo:start -Doptions=debug,other +----------+ * Waiting for a Geronimo Server If you already have a server started and just need to wait until the server has started: +----------+ mvn geronimo:wait-for-server +----------+ To only wait for a specific period you can sepcify a timeout in sections: +----------+ mvn geronimo:wait-for-server -Dtimeout=60 +----------+ * Stopping Geronimo Server To stop a server using the defaults, which is probably fine in most cases, just invoke the {{stop}} goal. Stopping a server does not require an assembly to be installed. +----------+ mvn geronimo:stop +----------+ Additional parameters may be passed in on the command-line: +----------+ mvn geronimo:stop -Dusername=system -Dpassword=manager -Dport=1099 +----------+ * Selecting an Assembly Once you have a set of assemblies configured with unique ids, you can specify the id of the assembly you wish to use on the command-line: +----------+ mvn geronimo:start -DassemblyId=tomcat +----------+ * Start/Stop for Integration Testing For inline integration testing, you can set the <<>> parameter on the <<>> goal to start the server, wait for it to load and then return control to Maven so that it can execute integration tests. +----------+ org.apache.geronimo.plugins geronimo-maven-plugin start-server pre-integration-test start true stop-server post-integration-test stop +----------+ * Installing an Assembly To just run the installation of the assembly: +----------+ mvn geronimo:install -DassemblyId=tomcat +----------+ To install a specific assembly archive, which need not be in the repository: +----------+ mvn geronimo:install -DassemblyArchive=/path/to/assembly.zip +----------+ For this to work, the file <> be a <<>> (or be in the same format, like a <<>>) and the archive should contain a full server assembly, specifically it needs to have a <<>> entry. This entry is used to discover <<>>. You can also change the base directory where the assembly is extracted to by setting the <<>> parameter. This is useful for a certain operating system that has a horribly small limit on the maximum size of a path name. <> The directory structure of the archive is still preserved when it is extracted. +----------+ mvn geronimo:install -DinstallDirectory=c:\ +----------+