tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1519346 - in /tomcat/maven-plugin/trunk: common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/ tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/
Date Mon, 02 Sep 2013 06:08:04 GMT
Author: olamy
Date: Mon Sep  2 06:08:03 2013
New Revision: 1519346

URL: http://svn.apache.org/r1519346
Log:
[MTOMCAT-165] http status 401 reported as success
Submitted by Emeric MARTINEAU

Modified:
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages_fr.properties
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployWarMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ListMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ReloadMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ResourcesMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RolesMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ServerInfoMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/SessionsMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StartMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StopMojo.java
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/UndeployMojo.java

Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
(original)
+++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
Mon Sep  2 06:08:03 2013
@@ -105,3 +105,7 @@ UndeployMojo.undeployError = Cannot unde
 # ReloadMojo
 
 ReloadMojo.reloadingApp = Reloading application at {0}
+
+# AbstractI18NTomcat6Mojo
+
+AbstractI18NTomcat6Mojo.tomcatHttStatusError = Tomcat return http status error
\ No newline at end of file

Modified: tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages_fr.properties
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages_fr.properties?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages_fr.properties
(original)
+++ tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages_fr.properties
Mon Sep  2 06:08:03 2013
@@ -105,3 +105,7 @@ UndeployMojo.undeployError = N'a pas pu 
 # ReloadMojo
 
 ReloadMojo.reloadingApp = Rechargement de l'application sur {0}
+
+# AbstractI18NTomcat6Mojo
+
+AbstractI18NTomcat6Mojo.tomcatHttStatusError = Tomcat a retourn\u00E9 un code HTTP en erreur
\ No newline at end of file

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.File;
 import java.io.IOException;
@@ -152,7 +153,7 @@ public abstract class AbstractDeployMojo
     {
         return tag;
     }
-
+    
     /**
      * Deploys the WAR to Tomcat.
      *
@@ -168,7 +169,10 @@ public abstract class AbstractDeployMojo
         getLog().info( messagesProvider.getMessage( "AbstractDeployMojo.deployingWar", getDeployedURL()
) );
 
         URL warURL = getWarFile().toURL();
-        log( getManager().deploy( getPath(), warURL, isUpdate(), getTag() ).getHttpResponseBody()
);
+        
+        TomcatManagerResponse tomcatResponse = getManager().deploy( getPath(), warURL, isUpdate(),
getTag() ) ;
+        
+        checkTomcatResponse(tomcatResponse) ;
     }
 
     /**
@@ -186,7 +190,10 @@ public abstract class AbstractDeployMojo
         getLog().info( messagesProvider.getMessage( "AbstractDeployMojo.deployingContext",
getDeployedURL() ) );
 
         URL contextURL = getContextFile().toURL();
-        log( getManager().deployContext( getPath(), contextURL, isUpdate(), getTag() ).getHttpResponseBody()
);
+        
+        TomcatManagerResponse tomcatResponse = getManager().deployContext( getPath(), contextURL,
isUpdate(), getTag() ) ;
+        
+        checkTomcatResponse(tomcatResponse) ;  
     }
 
     /**
@@ -206,6 +213,9 @@ public abstract class AbstractDeployMojo
 
         URL warURL = getWarFile().toURL();
         URL contextURL = getContextFile().toURL();
-        log( getManager().deployContext( getPath(), contextURL, warURL, isUpdate(), getTag()
).getHttpResponseBody() );
+
+        TomcatManagerResponse tomcatResponse = getManager().deployContext( getPath(), contextURL,
warURL, isUpdate(), getTag() ) ;
+      
+        checkTomcatResponse(tomcatResponse) ;  
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployWarMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployWarMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployWarMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractDeployWarMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.File;
 import java.io.IOException;
@@ -81,6 +82,8 @@ public class AbstractDeployWarMojo
 
         getLog().info( messagesProvider.getMessage( "AbstractDeployMojo.deployingWar", getDeployedURL()
) );
 
-        log( getManager().deploy( getPath(), warFile, isUpdate(), getTag(), warFile.length()
).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().deploy(  getPath(), warFile,
isUpdate(), getTag(), warFile.length() ) ;
+        
+        checkTomcatResponse(tomcatResponse) ;  
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
Mon Sep  2 06:08:03 2013
@@ -19,8 +19,10 @@ package org.apache.tomcat.maven.plugin.t
  */
 
 import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Component;
 import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 import org.apache.tomcat.maven.common.messages.MessagesProvider;
 
 /**
@@ -52,4 +54,23 @@ public abstract class AbstractI18NTomcat
     {
         return path;
     }
+    
+    /**
+     * Check response of Tomcat to know if ok or not.
+     * 
+     * @param tomcatResponse response of tomcat return by TomcatManager class
+     * 
+     * @throws MojoExecutionException if HTTP status code greater than 400 (included)
+     */
+    protected void checkTomcatResponse(final TomcatManagerResponse tomcatResponse)
+        	throws MojoExecutionException
+    {
+    	final int statusCode = tomcatResponse.getStatusCode() ;
+    	
+    	if (statusCode >= 400) {
+    		getLog().error(tomcatResponse.getHttpResponseBody()) ;
+    		
+    		throw new MojoExecutionException( messagesProvider.getMessage("AbstractI18NTomcat6Mojo.tomcatHttStatusError"))
;
+    	}
+    }       
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ListMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ListMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ListMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ListMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,10 @@ public class ListMojo
     {
         getLog().info( messagesProvider.getMessage( "ListMojo.listApps", getURL() ) );
 
-        log( getManager().list().getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().list() ;
+        
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ReloadMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ReloadMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ReloadMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ReloadMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,13 @@ public class ReloadMojo
     {
         getLog().info( messagesProvider.getMessage( "RedeployMojo.redeployApp", getDeployedURL()
) );
 
-        log( getManager().reload( getPath() ).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().reload( getPath() ) ;
+        
+        /* TODO : Tomcat always return http status 200. How check message to know error or
not,
+         * cause is can be in french, english....       
+         */
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );        
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ResourcesMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ResourcesMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ResourcesMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ResourcesMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -65,6 +66,10 @@ public class ResourcesMojo
             getLog().info( messagesProvider.getMessage( "ResourcesMojo.listTypedResources",
type, getURL() ) );
         }
 
-        log( getManager().getResources( type ).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().getResources( type );
+        
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );          
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RolesMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RolesMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RolesMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/RolesMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,13 @@ public class RolesMojo
     {
         getLog().info( messagesProvider.getMessage( "RolesMojo.listRoles", getURL() ) );
 
-        log( getManager().getRoles().getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().getRoles() ;
+        
+        /* TODO : Tomcat always return http status 200. How check message to know error or
not,
+         * cause is can be in french, english....       
+         */        
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );          
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ServerInfoMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ServerInfoMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ServerInfoMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/ServerInfoMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -46,7 +47,11 @@ public class ServerInfoMojo
         throws MojoExecutionException, TomcatManagerException, IOException
     {
         getLog().info( messagesProvider.getMessage( "ServerInfoMojo.listInfo", getURL() )
);
-
-        log( getManager().getServerInfo().getHttpResponseBody() );
+       
+        TomcatManagerResponse tomcatResponse = getManager().getServerInfo() ;
+        
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );                
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/SessionsMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/SessionsMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/SessionsMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/SessionsMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,10 @@ public class SessionsMojo
     {
         getLog().info( messagesProvider.getMessage( "SessionsMojo.listSessions", getDeployedURL()
) );
 
-        log( getManager().getSessions( getPath() ).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().getSessions( getPath() ) ;
+        
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );            
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StartMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StartMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StartMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StartMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,13 @@ public class StartMojo
     {
         getLog().info( messagesProvider.getMessage( "StartMojo.startingApp", getDeployedURL()
) );
 
-        log( getManager().start( getPath() ).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().start( getPath() ) ;
+        
+        /* TODO : Tomcat always return http status 200. How check message to know error or
not,
+         * cause is can be in french, english....       
+         */
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );            
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StopMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StopMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StopMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/StopMojo.java
Mon Sep  2 06:08:03 2013
@@ -22,6 +22,7 @@ package org.apache.tomcat.maven.plugin.t
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -47,6 +48,13 @@ public class StopMojo
     {
         getLog().info( messagesProvider.getMessage( "StopMojo.stoppingApp", getDeployedURL()
) );
 
-        log( getManager().stop( getPath() ).getHttpResponseBody() );
+        TomcatManagerResponse tomcatResponse = getManager().stop( getPath() ) ;
+        
+        /* TODO : Tomcat always return http status 200. How check message to know error or
not,
+         * cause is can be in french, english....       
+         */
+        checkTomcatResponse(tomcatResponse) ;          
+        
+        log( tomcatResponse.getHttpResponseBody() );      
     }
 }

Modified: tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/UndeployMojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/UndeployMojo.java?rev=1519346&r1=1519345&r2=1519346&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/UndeployMojo.java
(original)
+++ tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/UndeployMojo.java
Mon Sep  2 06:08:03 2013
@@ -23,6 +23,7 @@ import org.apache.maven.plugin.MojoExecu
 import org.apache.maven.plugins.annotations.Mojo;
 import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.tomcat.maven.common.deployer.TomcatManagerException;
+import org.apache.tomcat.maven.common.deployer.TomcatManagerResponse;
 
 import java.io.IOException;
 
@@ -60,7 +61,14 @@ public class UndeployMojo
 
         try
         {
-            log( getManager().undeploy( getPath() ).getHttpResponseBody() );
+            TomcatManagerResponse tomcatResponse = getManager().undeploy( getPath() ) ;
+            
+            /* TODO : Tomcat always return http status 200. How check message to know error
or not,
+             * cause is can be in french, english....       
+             */
+            checkTomcatResponse(tomcatResponse) ;          
+            
+            log( tomcatResponse.getHttpResponseBody() );                 
         }
         catch ( TomcatManagerException exception )
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message