You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/09/13 08:55:20 UTC

svn commit: r442872 - in /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin: ./ src/main/java/org/apache/geronimo/mavenplugins/geronimo/ src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ src/main/java/org/apache/geronimo/mavenplug...

Author: jdillon
Date: Tue Sep 12 23:55:19 2006
New Revision: 442872

URL: http://svn.apache.org/viewvc?view=rev&rev=442872
Log:
(GERONIMO-2359) Applied modified versions of patches submitted by Prasad (thanks)
Moved all server related mojos to the o.a.g.m.g.server package
Added all new module mojos to the o.a.g.m.g.module package
Renamed install, start and stop goals to install-assembly, start-server and stop-server
Added aliases for install, start, stop that point to install-assembly, start-server, stop-server
Adding (augmented from patches) start-module, stop-module, deploy-module and undeply-module
Added aliases deploy and undeploy that point to deploy-module and undeply-module
Added list-modules goal to show what modules are running and non-running
Module operations show tree-like view of targetId's when available

Added:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java   (contents, props changed)
      - copied, changed from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerMojoSupport.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java   (contents, props changed)
      - copied, changed from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallAssemblyMojo.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java   (contents, props changed)
      - copied, changed from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallerMojoSupport.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java   (contents, props changed)
      - copied, changed from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StartServerMojo.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java   (with props)
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java   (contents, props changed)
      - copied, changed from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StopServerMojo.java
Removed:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallAssemblyMojo.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallerMojoSupport.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerMojoSupport.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StartServerMojo.java
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StopServerMojo.java
Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/pom.xml
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/pom.xml?view=diff&rev=442872&r1=442871&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/pom.xml (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/pom.xml Tue Sep 12 23:55:19 2006
@@ -40,6 +40,12 @@
     </description>
 
     <dependencies>
+      <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-deploy-jsr88</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-kernel</artifactId>

Copied: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java (from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerMojoSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java?view=diff&rev=442872&p1=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerMojoSupport.java&r1=442765&p2=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerMojoSupport.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java Tue Sep 12 23:55:19 2006
@@ -20,19 +20,41 @@
 package org.apache.geronimo.mavenplugins.geronimo;
 
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 
 import org.apache.geronimo.genesis.AntMojoSupport;
 
 /**
- * Support for Geronimo server mojos.
+ * Support for Geronimo mojos.
  *
  * @version $Rev$ $Date$
  */
-public abstract class ServerMojoSupport
-    extends AntMojoSupport
+public abstract class GeronimoMojoSupport
+        extends AntMojoSupport
 {
+    //
+    // NOTE: Not all mojos need Ant support, but due to the inability of Maven to inject custom components
+    //       with their fields initalized we must use inheritence, see below.
+    //
+
+    //
+    // NOTE: These fields are used by all mojo's except for install, which does not need to
+    //       connect to the server, but there is as of yet, no easy way to share common
+    //       code in a Mavne plugin w/o inheritence, so for now these are duplicated for
+    //       all mojos.
+    //
+
+    /**
+     * The hostname of the server to connect to.
+     *
+     * @parameter expression="${hostname}" default-value="localhost"
+     */
+    protected String hostname = null;
+
     /**
-     * The port number to connect to the server..
+     * The port number to connect to the server.
      *
      * @parameter expression="${port}" default-value="1099"
      */
@@ -68,4 +90,44 @@
     protected MavenProject getProject() {
         return project;
     }
+
+    /**
+     * ???
+     *
+     * @component
+     * @required
+     * @readonly
+     */
+    protected ArtifactFactory artifactFactory = null;
+
+    protected ArtifactFactory getArtifactFactory() {
+        return artifactFactory;
+    }
+
+    /**
+     * ???
+     *
+     * @component
+     * @required
+     * @readonly
+     */
+    protected ArtifactResolver artifactResolver = null;
+
+    protected ArtifactResolver getArtifactResolver() {
+        return artifactResolver;
+    }
+
+    /**
+     * ???
+     *
+     * @parameter expression="${localRepository}"
+     * @readonly
+     * @required
+     */
+    protected ArtifactRepository artifactRepository = null;
+
+    protected ArtifactRepository getArtifactRepository() {
+        return artifactRepository;
+    }
+
 }

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/GeronimoMojoSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo;
+
+import java.io.File;
+import org.apache.geronimo.genesis.ArtifactItem;
+
+/**
+ * Module artifact configuration.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ModuleConfig
+    extends ArtifactItem
+{
+    /**
+     * External plan.
+     *
+     * @parameter
+     * @optional
+     */
+    private File plan;
+
+    //
+    // FIXME: This is bad, as someone can configure an module's archive here which will cause unexpected
+    //        problems.
+
+    private File archive;
+
+    public void setPlan(final File plan) {
+        this.plan = plan;
+    }
+
+    public File getPlan() {
+        return plan;
+    }
+
+    public void setArchive(final File archive) {
+        this.archive = archive;
+    }
+
+    public File getArchive() {
+        return archive;
+    }
+
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ModuleConfig.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java?view=diff&rev=442872&r1=442871&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/ServerProxy.java Tue Sep 12 23:55:19 2006
@@ -64,12 +64,12 @@
         init(url, environment);
     }
 
-    public ServerProxy(final int port, final String username, final String password) throws Exception {
+    public ServerProxy(final String hostname, final int port, final String username, final String password) throws Exception {
         //
-        // FIXME: Should be able to pass in hostname too
+        // TODO: Check if this is the right way to build up the URI
         //
         
-        this("service:jmx:rmi://localhost/jndi/rmi://localhost:" + port + "/JMXConnector", username, password);
+        this("service:jmx:rmi://" + hostname + "/jndi/rmi://" + hostname + ":" + port + "/JMXConnector", username, password);
     }
 
     public ServerProxy(final String url, final String username, final String password) throws Exception {
@@ -142,8 +142,6 @@
     }
 
     public void shutdown() {
-        log.info("Attempting to shutdown the remote server");
-        
         try {
             invoke("shutdown");
         }

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+import java.io.File;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.enterprise.deploy.spi.status.DeploymentStatus;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import org.apache.geronimo.mavenplugins.geronimo.ModuleConfig;
+
+/**
+ * Deploy modules (and optionally starting them) to a Geronimo server.
+ *
+ * @goal deploy-module
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DeployModuleMojo
+    extends ModuleMojoSupport
+{
+    /**
+     * List of module artifact configurations.  Artifacts need to point to jar | war | ear | rar archive.
+     *
+     * @parameter
+     */
+    protected ModuleConfig[] modules = null;
+
+    /**
+     * A file which points to a specific module's jar | war | ear | rar archive.
+     * If this parameter is set, then it will be used instead of from the
+     * modules configuration.
+     *
+     * @parameter expression="${moduleArchive}"
+     * @optional
+     */
+    protected File moduleArchive = null;
+
+    /**
+     * The fully qualified path of the external plan file (geronimo-web.xml).
+     * The application module may already have included in the package a deployment plan or the
+     * application is so simple that may not require any deployment plan.
+     * 
+     * @parameter expression="${modulePlan}"
+     * @optional
+     */
+    private File modulePlan = null;
+
+    /**
+     * Flag to indicate if modules should be started after they have been distributed to the server.
+     *
+     * @parameter default-value="true"
+     * @optional
+     */
+    private boolean startModules = false;
+
+    public void doExecute() throws Exception {
+        if (moduleArchive != null) {
+            log.info("Using non-artifact based module archive: " + moduleArchive);
+
+            // Add the single module to the list
+            ModuleConfig moduleConfig = new ModuleConfig();
+            moduleConfig.setArchive(moduleArchive);
+            moduleConfig.setPlan(modulePlan);
+
+            modules = new ModuleConfig[] {
+                moduleConfig
+            };
+        }
+        else if (modules == null || modules.length == 0) {
+            throw new MojoExecutionException("At least one module configuration (or moduleArchive) must be specified");
+        }
+
+        List completed = new ArrayList();
+        DeploymentManager manager = getDeploymentManager();
+        Target[] targets = manager.getTargets();
+
+        for (int i=0; i<modules.length; i++) {
+            File file = getModuleArchive(modules[i]);
+            log.info("Distributing module artifact: " + file);
+
+            ProgressObject progress = manager.distribute(targets, file, modules[i].getPlan());
+            DeploymentStatus status = waitFor(progress);
+
+            if (status.isFailed()) {
+                throw new MojoExecutionException("Distribution failed: " + status.getMessage());
+            }
+            else {
+                completed.add(progress.getResultTargetModuleIDs());
+            }
+        }
+
+        if (startModules) {
+            log.info("Starting modules...");
+
+            Iterator iter = completed.iterator();
+            while (iter.hasNext()) {
+                TargetModuleID[] moduleIds = (TargetModuleID[])iter.next();
+                for (int i=0; i < moduleIds.length; i++) {
+                    String url = moduleIds[i].getWebURL();
+                    log.info("Starting module: " + moduleIds[i].getModuleID() + (url == null ? "" : ("; URL: " + url)));
+                }
+
+                ProgressObject progress = manager.start(moduleIds);
+                DeploymentStatus status = waitFor(progress);
+
+                if (status.isFailed()) {
+                    throw new MojoExecutionException("Failed to start modules: " + status.getMessage());
+                }
+
+                log.info("Started module(s):");
+                logModules(moduleIds, "    ");
+            }
+        }
+    }
+
+    private File getModuleArchive(final ModuleConfig module) throws MojoExecutionException {
+        //
+        // HACK: For single non-artifact module archive
+        //
+        if (module.getArchive() != null) {
+            return module.getArchive();
+        }
+
+        Artifact artifact = getArtifact(module);
+
+        File file = artifact.getFile();
+        if (file == null) {
+            throw new MojoExecutionException("Module artifact does not have an attached file: " + module);
+        }
+
+        String type = artifact.getType();
+        log.debug("Artifact file is: " + file + " (" + type + ")");
+
+        if ((!"war".equals(type)) &&
+            (!"ear".equals(type)) &&
+            (!"rar".equals(type)) &&
+            (!"jar".equals(type)))
+        {
+            throw new MojoExecutionException("Module does not look like a J2EE archive: " + module);
+        }
+
+        return file;
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Alias for deploy-module.
+ *
+ * @goal deploy
+ *
+ * @version $Rev$ $Date$
+ */
+public class DeployMojo
+    extends DeployModuleMojo
+{
+    // Empty
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/DeployMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+/**
+ * List the modules.
+ *
+ * @goal list-modules
+ *
+ * @version $Rev$ $Date$
+ */
+public class ListModulesMojo
+    extends ModuleMojoSupport
+{
+    public void doExecute() throws Exception {
+        DeploymentManager manager = getDeploymentManager();
+        Target[] targets = manager.getTargets();
+        
+        log.info("");
+        log.info("Running Modules");
+        log.info("===============");
+
+        logModules(manager.getRunningModules(null, targets));
+
+        log.info("");
+        log.info("Non-Running Modules");
+        log.info("===================");
+
+        logModules(manager.getNonRunningModules(null, targets));
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ListModulesMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,254 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.enterprise.deploy.spi.status.ProgressListener;
+import javax.enterprise.deploy.spi.status.ProgressEvent;
+import javax.enterprise.deploy.spi.status.DeploymentStatus;
+import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
+import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
+
+import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
+import org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport;
+
+import org.apache.geronimo.genesis.ArtifactItem;
+
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Support for mojos that operate on modules.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class ModuleMojoSupport
+    extends GeronimoMojoSupport
+{
+    private static final String URI_PREFIX = "deployer:geronimo:jmx";
+
+    private DeploymentManager deploymentManager;
+
+    protected DeploymentManager getDeploymentManager() throws IOException, DeploymentManagerCreationException {
+        if (deploymentManager == null) {
+            // Register the Geronimo factory
+            DeploymentFactoryManager manager = DeploymentFactoryManager.getInstance();
+            manager.registerDeploymentFactory(new DeploymentFactoryImpl());
+
+            String uri = URI_PREFIX + "://" + hostname + ":" + port;
+
+            DeploymentFactoryManager factoryManager = DeploymentFactoryManager.getInstance();
+            deploymentManager = factoryManager.getDeploymentManager(uri, username, password);
+        }
+
+        return deploymentManager;
+    }
+
+    protected DeploymentStatus waitFor(final ProgressObject progress) throws InterruptedException {
+        assert progress != null;
+
+        //
+        // TODO: Add timeout?
+        //
+        
+        ProgressListener listener = new ProgressListener()
+        {
+            public void handleProgressEvent(final ProgressEvent event) {
+                DeploymentStatus status = event.getDeploymentStatus();
+
+                if (!status.isRunning()) {
+                    synchronized (progress) {
+                        progress.notify();
+                    }
+                }
+            }
+        };
+
+        progress.addProgressListener(listener);
+
+        synchronized (progress) {
+            while (progress.getDeploymentStatus().isRunning()) {
+                progress.wait();
+            }
+        }
+
+        return progress.getDeploymentStatus();
+    }
+
+    /**
+     * Returns the Geronimo moduleId for the given artifact.
+     *
+     * @param item  The artifact item to get the moduleId for.
+     * @return      The moduleId of the given artifact item.
+     */
+    protected String getModuleId(final ArtifactItem item) {
+        assert item != null;
+
+        return item.getGroupId() + "/" + item.getArtifactId() + "/" + item.getVersion() + "/" + item.getType();
+    }
+
+    protected boolean isModuleStarted(final String moduleId) throws Exception {
+        assert moduleId != null;
+
+        log.debug("Checking if module is started: " + moduleId);
+        
+        DeploymentManager manager = getDeploymentManager();
+
+        Target[] targets = manager.getTargets();
+        TargetModuleID targetIds[] = manager.getRunningModules(null, targets);
+
+        for (int i = 0; i < targetIds.length; i++) {
+            if (moduleId.equals(targetIds[i].getModuleID())) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    protected TargetModuleID[] findModules(final String moduleId, final TargetModuleID targetIds[]) {
+        assert moduleId != null;
+        assert targetIds != null;
+
+        List found = new ArrayList();
+
+        log.debug("Scanning for modules that match: " + moduleId);
+        for (int i = 0; i < targetIds.length; i++) {
+            log.debug("Checking: " + targetIds[i].getModuleID());
+
+            if (moduleId.equals(targetIds[i].getModuleID())) {
+                found.add(targetIds[i]);
+            }
+        }
+
+        return (TargetModuleID[]) found.toArray(new TargetModuleID[found.size()]);
+    }
+
+    //
+    // TODO: Can probably wrap up some of this into findModules with a flag for running or non-running
+    //
+    
+    protected void startModule(final String moduleId) throws Exception {
+        assert moduleId != null;
+        
+        if (isModuleStarted(moduleId)) {
+            throw new MojoExecutionException("Module is already started: " + moduleId);
+        }
+
+        DeploymentManager manager = getDeploymentManager();
+        Target[] targets = manager.getTargets();
+        TargetModuleID[] targetIds = manager.getNonRunningModules(null, targets);
+        TargetModuleID[] found = findModules(moduleId, targetIds);
+
+        if (found.length == 0) {
+            throw new MojoExecutionException("Module is not deployed: " + moduleId);
+        }
+
+        log.info("Starting module: " + moduleId);
+        ProgressObject progress = manager.start(found);
+
+        DeploymentStatus status = waitFor(progress);
+        if (status.isFailed()) {
+            throw new MojoExecutionException("Failed to start module: " + moduleId);
+        }
+
+        log.info("Started module(s):");
+        logModules(found, "    ");
+    }
+
+    protected void stopModule(final String moduleId) throws Exception {
+        assert moduleId != null;
+        
+        if (!isModuleStarted(moduleId)) {
+            throw new MojoExecutionException("Module is not started: " + moduleId);
+        }
+
+        DeploymentManager manager = getDeploymentManager();
+        Target[] targets = manager.getTargets();
+        TargetModuleID[] targetIds = manager.getRunningModules(null, targets);
+        TargetModuleID[] found = findModules(moduleId, targetIds);
+
+        if (found.length == 0) {
+            throw new MojoExecutionException("Module not deployed: " + moduleId);
+        }
+
+        log.info("Stopping module: " + moduleId);
+        ProgressObject progress = manager.stop(found);
+
+        DeploymentStatus status = waitFor(progress);
+        if (status.isFailed()) {
+            throw new MojoExecutionException("Failed to stop module: " + moduleId);
+        }
+
+        log.info("Stopped module(s):");
+        logModules(found, "    ");
+    }
+
+    protected void undeployModule(final String moduleId) throws Exception {
+        assert moduleId != null;
+
+        stopModule(moduleId);
+        
+        DeploymentManager manager = getDeploymentManager();
+        Target[] targets = manager.getTargets();
+        TargetModuleID[] targetIds = manager.getNonRunningModules(null, targets);
+        TargetModuleID[] found = findModules(moduleId, targetIds);
+
+        if (found.length == 0) {
+            throw new Exception("Module is not deployed: " + moduleId);
+        }
+
+        log.info("Undeploying module: " + moduleId);
+        ProgressObject progress = manager.undeploy(found);
+
+        DeploymentStatus status = waitFor(progress);
+        if (status.isFailed()) {
+            throw new MojoExecutionException("Failed to undeploy module: " + moduleId);
+        }
+
+        log.info("Undeployed module(s):");
+        logModules(found, "    ");
+    }
+
+    protected void logModules(final TargetModuleID[] targetIds) {
+        logModules(targetIds, "");
+    }
+
+    protected void logModules(final TargetModuleID[] targetIds, final String pad) {
+        assert targetIds != null;
+        assert pad != null;
+
+        for (int i=0; i<targetIds.length; i++) {
+            String url = targetIds[i].getWebURL();
+            log.info(pad + "[" + i + "] " + targetIds[i].getModuleID() + (url == null ? "" : ("; URL: " + url)));
+
+            TargetModuleID[] children = targetIds[i].getChildTargetModuleID();
+            if (children != null) {
+                logModules(children, pad + "    ");
+            }
+        }
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/ModuleMojoSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Start a module running on Geronimo server.
+ *
+ * @goal start-module
+ * 
+ * @version $Rev$ $Date$
+ */
+public class StartModuleMojo
+    extends StartStopUndeployMojoSupport
+{
+    //
+    // TODO: Add forced restart if already started
+    //
+
+    public void doExecute() throws Exception {
+        startModule(moduleId);
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Support for start/stop/undeploy mojos.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class StartStopUndeployMojoSupport
+    extends ModuleMojoSupport
+{
+    //
+    // TODO: Add support to take a set of ModuleConfig's and operate on them
+    //
+    
+    /**
+     * The id of the module to be started in the format of <tt>groupId/artifactId/version/type</tt>.
+     *
+     * @parameter expression="${moduleId}
+     * @required
+     */
+    protected String moduleId = null;
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StartStopUndeployMojoSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Stop a module running on Geronimo server.
+ * 
+ * @goal stop-module
+ * 
+ * @version $Rev$ $Date$
+ */
+public class StopModuleMojo
+    extends StartStopUndeployMojoSupport
+{
+    //
+    // TODO: Add ignore not running flag ?
+    //
+    
+    public void doExecute() throws Exception {
+        stopModule(moduleId);
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/StopModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Undeploy a module from a running Geronimo server. If the module is running, it is stopped by default. 
+ * 
+ * @goal undeploy-module
+ * 
+ * @version $Rev$ $Date$
+ */
+public class UndeployModuleMojo
+    extends StartStopUndeployMojoSupport
+{
+    //
+    // TODO: Re-add support to skip undeploy if module is not yet stopped
+    //
+    
+    public void doExecute() throws Exception {
+        undeployModule(moduleId);
+    }
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployModuleMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.module;
+
+/**
+ * Alias for undeploy-module.
+ *
+ * @goal undeploy
+ *
+ * @version $Rev$ $Date$
+ */
+public class UndeployMojo
+    extends UndeployModuleMojo
+{
+    // Empty
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/module/UndeployMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java (from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallAssemblyMojo.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java?view=diff&rev=442872&p1=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallAssemblyMojo.java&r1=442765&p2=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallAssemblyMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java Tue Sep 12 23:55:19 2006
@@ -17,12 +17,12 @@
  * under the License.
  */
 
-package org.apache.geronimo.mavenplugins.geronimo;
+package org.apache.geronimo.mavenplugins.geronimo.server;
 
 /**
  * Install a Geronimo server assembly.
  *
- * @goal install
+ * @goal install-assembly
  *
  * @version $Rev$ $Date$
  */

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallAssemblyMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.server;
+
+/**
+ * Alias for install-assembly.
+ *
+ * @goal install
+ *
+ * @version $Rev$ $Date$
+ */
+public class InstallMojo
+    extends InstallAssemblyMojo
+{
+    // Empty
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java (from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallerMojoSupport.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java?view=diff&rev=442872&p1=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallerMojoSupport.java&r1=442765&p2=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/InstallerMojoSupport.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java Tue Sep 12 23:55:19 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.mavenplugins.geronimo;
+package org.apache.geronimo.mavenplugins.geronimo.server;
 
 import java.io.File;
 import java.io.IOException;
@@ -27,9 +27,6 @@
 import java.util.zip.ZipFile;
 import java.util.zip.ZipEntry;
 
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.Artifact;
 
 import org.apache.maven.plugin.MojoExecutionException;
@@ -39,6 +36,8 @@
 
 import org.apache.tools.ant.taskdefs.Expand;
 import org.apache.tools.ant.taskdefs.Chmod;
+import org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport;
+import org.apache.geronimo.mavenplugins.geronimo.AssemblyConfig;
 
 /**
  * Common assembly install support.
@@ -46,7 +45,7 @@
  * @version $Rev$ $Date$
  */
 public abstract class InstallerMojoSupport
-    extends ServerMojoSupport
+    extends GeronimoMojoSupport
 {
     /**
      * Enable forced install refresh.
@@ -112,48 +111,6 @@
 
     protected int installType;
 
-    //
-    // MojoSupport Hooks
-    //
-
-    /**
-     * ???
-     *
-     * @component
-     * @required
-     * @readonly
-     */
-    protected ArtifactFactory artifactFactory = null;
-
-    protected ArtifactFactory getArtifactFactory() {
-        return artifactFactory;
-    }
-
-    /**
-     * ???
-     *
-     * @component
-     * @required
-     * @readonly
-     */
-    protected ArtifactResolver artifactResolver = null;
-
-    protected ArtifactResolver getArtifactResolver() {
-        return artifactResolver;
-    }
-
-    /**
-     * ???
-     *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
-     */
-    protected ArtifactRepository artifactRepository = null;
-
-    protected ArtifactRepository getArtifactRepository() {
-        return artifactRepository;
-    }
 
     private File discoverGeronimoHome(final File archive) throws MojoExecutionException {
         log.debug("Attempting to discover geronimoHome...");
@@ -228,8 +185,9 @@
     /**
      * Selects the assembly artifact tp be used for installation.
      *
-     * @return
-     * @throws MojoExecutionException
+     * @return The assembly artifact selected to be installed.
+     *
+     * @throws MojoExecutionException   Failed to select assembly artifact
      */
     protected Artifact getAssemblyArtifact() throws MojoExecutionException {
         AssemblyConfig config;

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.server;
+
+/**
+ * Alias for start-server.
+ *
+ * @goal start
+ *
+ * @version $Rev$ $Date$
+ */
+public class StartMojo
+    extends StartServerMojo
+{
+    // Empty
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java (from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StartServerMojo.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java?view=diff&rev=442872&p1=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StartServerMojo.java&r1=442765&p2=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StartServerMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java Tue Sep 12 23:55:19 2006
@@ -17,21 +17,23 @@
  * under the License.
  */
 
-package org.apache.geronimo.mavenplugins.geronimo;
-
-import org.apache.maven.plugin.MojoExecutionException;
+package org.apache.geronimo.mavenplugins.geronimo.server;
 
 import java.io.File;
 import java.util.Timer;
 import java.util.TimerTask;
 
+import org.apache.maven.plugin.MojoExecutionException;
+
 import org.apache.tools.ant.taskdefs.Java;
+
 import org.apache.geronimo.genesis.ObjectHolder;
+import org.apache.geronimo.mavenplugins.geronimo.ServerProxy;
 
 /**
  * Start the Geronimo server.
  *
- * @goal start
+ * @goal start-server
  *
  * @version $Rev$ $Date$
  */
@@ -218,7 +220,7 @@
         }
 
         // Verify server started
-        ServerProxy server = new ServerProxy(port, username, password);
+        ServerProxy server = new ServerProxy(hostname, port, username, password);
         boolean started = false;
         while (!started) {
             if (verifyTimedOut.isSet()) {

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java?view=auto&rev=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java (added)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java Tue Sep 12 23:55:19 2006
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+package org.apache.geronimo.mavenplugins.geronimo.server;
+
+/**
+ * Alias for stop-server.
+ *
+ * @goal stop
+ *
+ * @version $Rev$ $Date$
+ */
+public class StopMojo
+    extends StopServerMojo
+{
+    // Empty
+}

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java (from r442765, geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StopServerMojo.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java?view=diff&rev=442872&p1=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StopServerMojo.java&r1=442765&p2=geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java&r2=442872
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/StopServerMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java Tue Sep 12 23:55:19 2006
@@ -17,22 +17,25 @@
  * under the License.
  */
 
-package org.apache.geronimo.mavenplugins.geronimo;
+package org.apache.geronimo.mavenplugins.geronimo.server;
 
 import org.apache.maven.plugin.MojoExecutionException;
 
+import org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport;
+import org.apache.geronimo.mavenplugins.geronimo.ServerProxy;
+
 /**
  * Stop the Geronimo server.
  *
- * @goal stop
+ * @goal stop-server
  *
  * @version $Rev$ $Date$
  */
 public class StopServerMojo
-    extends ServerMojoSupport
+    extends GeronimoMojoSupport
 {
     protected void doExecute() throws Exception {
-        ServerProxy server = new ServerProxy(port, username, password);
+        ServerProxy server = new ServerProxy(hostname, port, username, password);
 
         //
         // TODO: Maybe we just need isStarted() not need to be fully started?

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain