geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r495849 - /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
Date Sat, 13 Jan 2007 08:40:10 GMT
Author: jdillon
Date: Sat Jan 13 00:40:10 2007
New Revision: 495849

URL: http://svn.apache.org/viewvc?view=rev&rev=495849
Log:
Add flag to allow build to continue if stop-server fails

Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/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=495849&r1=495848&r2=495849
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StopServerMojo.java
Sat Jan 13 00:40:10 2007
@@ -34,6 +34,13 @@
 public class StopServerMojo
     extends ReportingMojoSupport
 {
+    /**
+     * Fail the build if the server is not started.
+     *
+     * @parameter expression="${failIfNotStarted}" default-value="true"
+     */
+    private boolean failIfNotStarted = true;
+    
     protected void doExecute() throws Exception {
         ServerProxy server = new ServerProxy(hostname, port, username, password);
 
@@ -42,7 +49,14 @@
         //
         
         if (!server.isFullyStarted()) {
-            throw new MojoExecutionException("Server does not appear to be started");
+            String msg = "Server does not appear to be started";
+            
+            if (failIfNotStarted) {
+                throw new MojoExecutionException(msg);
+            }
+            else {
+                log.warn(msg);
+            }
         }
         else {
             log.info("Stopping Geronimo server...");



Mime
View raw message