tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1519350 - /tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
Date Mon, 02 Sep 2013 06:09:25 GMT
Author: olamy
Date: Mon Sep  2 06:09:24 2013
New Revision: 1519350

URL: http://svn.apache.org/r1519350
Log:
display more info only if users choose to use -e or -X maven option

Modified:
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java

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=1519350&r1=1519349&r2=1519350&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:09:24 2013
@@ -35,7 +35,7 @@ public abstract class AbstractI18NTomcat
     extends AbstractMojo
 {
 
-    @Component( role = MessagesProvider.class )
+    @Component(role = MessagesProvider.class)
     protected MessagesProvider messagesProvider;
 
     // ----------------------------------------------------------------------
@@ -46,7 +46,7 @@ public abstract class AbstractI18NTomcat
      * The webapp context path to use for the web application being run. This must always
start with a forward-slash
      * ('/').
      */
-    @Parameter( property = "maven.tomcat.path", defaultValue = "/${project.artifactId}",
required = true )
+    @Parameter(property = "maven.tomcat.path", defaultValue = "/${project.artifactId}", required
= true)
     protected String path;
 
 
@@ -54,23 +54,25 @@ 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
+    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",
statusCode)) ;
-    	}
-    }       
+        final int statusCode = tomcatResponse.getStatusCode();
+
+        if ( statusCode >= 400 )
+        {
+            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError",
statusCode ) );
+
+            throw new MojoExecutionException(
+                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError",
statusCode ) + ": "
+                    + tomcatResponse.getHttpResponseBody() );
+        }
+    }
 }



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


Mime
View raw message