Date: 2004-08-18T17:22:33
Editor: DavidJencks <djencks@apache.org>
Wiki: Apache Geronimo Wiki
Page: Running
URL: http://wiki.apache.org/geronimo/Running
no comment
Change Log:
------------------------------------------------------------------------------
@@ -2,7 +2,113 @@
If you use Java Server Pages then Geronimo will need to have the Java Development Kit `tools.jar`
file on its classpath. If you're using a Sun JDK then the easiest (although cheesiest) way
to make this possible is to copy `tools.jar` from `$JAVA_HOME/lib` to `$JAVA_HOME/jre/lib/ext`.
-= Running The Server =
+= Running Geronimo From Maven =
+
+The simplest way to deploy and run geronimo for a project that uses maven is to use the geronimo
maven deploy plugin, installed when you build geronimo. It is convenient to have a separate
module in your project
+to deal with installing and running your application in geronimo. It may also be convenient
to have a module for running integration tests. OpenEJB includes an integration test running
module, modules/itests: the maven.xml shows how to deploy and start geronimo, deploy your
application, run tests, and shutdown geronimo. Here we will concentrate on how to start geronimo
and deploy your application.
+
+This goal shows how to deploy in the target directory of your module:
+
+ {{{
+ <goal name="installGeronimo">
+ <ant:delete dir="${maven.build.dir}/geronimo"/>
+ <deploy:unpackServer
+ geronimoVersion="1.0-SNAPSHOT"/>
+ </goal>
+}}}
+
+These additional properties provide more control:
+geronimoName=openejb will deploy the openejb server: this is build on the geronimo core but
does not include a web server.
+targetDir specifies where geronimo will be deployed. The default is target/geronimo
+
+This goal shows how to start the instance of geronimo you just deployed in the default target/geronimo
directory:
+ {{{
+ <goal name="startGeronimo">
+ <deploy:startRemoteServer
+ geronimoTarget="${maven.build.dir}/geronimo"
+ configs="org/apache/geronimo/DebugConsole"/>
+ <deploy:waitForStarted
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"
+ id="org/apache/geronimo/DebugConsole"/>
+ <echo message="server has started"/>
+ </goal>
+
+}}}
+
+configs in startRemoteServer may contain a space delimited list of configurations to start.
Typically you will want to wait for the last one to start.
+
+This goal shows how to deploy your application in this running instance of geronimo;
+
+ {{{
+ <goal name="startMyApp">
+
+ <deploy:distribute
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"
+ home="${basedir}"
+ module="${maven.repo.local}/myproject/jars/myapplication-1.0-SNAPSHOT.jar"
+ />
+ <deploy:start
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"
+ id="org/myproject/MyConfigurationName"/>
+ </goal>
+
+}}}
+
+Here, `org/myproject/MyConfigurationName` is the configId specified in the geronimo-specific
deployment descriptor or deployment plan.
+
+In deploy:distribute you may include an external deployment plan
+
+ {{{
+plan="path/to/external/plan.xml"
+}}}
+
+You can deploy and start any number of applications using goals similar to this.
+
+This goal shows how to stop and undeploy your application:
+
+ {{{
+ <goal name="stopMyApp">
+ <deploy:stop
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"
+ id="org/myproject/MyConfigurationName"/>
+ <ant:echo>undeploy</ant:echo>
+ <deploy:undeploy
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"
+ id="org/myproject/MyConfigurationName"/>
+ </goal>
+
+}}}
+
+This goal shows how to stop the geronimo server:
+
+ {{{
+ <goal name="stopGeronimo">
+ <deploy:stopRemoteServer
+ uri="deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector"
+ username="system"
+ password="manager"/>
+ </goal>
+}}}
+
+= Running The Server From The Command Line =
+
+First, you must unpack the geronimo binary ${maven.repo.local}/geronimo/jars/geronimo-assembly-1.0-SNAPSHOT.jar
into the location you wish to install geronimo. For instance,
+
+ {{{
+$ cd myproject
+$ cp ~/.maven/repository/geronimo/jars/geronimo-assembly-1.0-SNAPSHOT.jar
+$ jar -xf geronimo-assembly-1.0-SNAPSHOT.jar
+}}}
The Geronimo server is started using the executable jar file `bin/server.jar`.
{{{
|