You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ol...@apache.org on 2013/09/02 08:11:11 UTC

svn commit: r1519353 - 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/ tomcat7-maven-plugin/src/main/java/o...

Author: olamy
Date: Mon Sep  2 06:11:10 2013
New Revision: 1519353

URL: http://svn.apache.org/r1519353
Log:
display the reason phrase too

Modified:
    tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
    tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
    tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.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=1519353&r1=1519352&r2=1519353&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:11:10 2013
@@ -112,4 +112,4 @@ AbstractI18NTomcat6Mojo.tomcatHttStatusE
 
 #AbstractTomcat7Mojo
 
-AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}
+AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}, Reason Phrase: {1}

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=1519353&r1=1519352&r2=1519353&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:11:10 2013
@@ -68,10 +68,12 @@ public abstract class AbstractI18NTomcat
 
         if ( statusCode >= 400 )
         {
-            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) );
+            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
+                                                         tomcatResponse.getReasonPhrase() ) );
 
             throw new MojoExecutionException(
-                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) + ": "
+                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
+                                             tomcatResponse.getReasonPhrase() ) + ": "
                     + tomcatResponse.getHttpResponseBody() );
         }
     }

Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java
URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java?rev=1519353&r1=1519352&r2=1519353&view=diff
==============================================================================
--- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java (original)
+++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java Mon Sep  2 06:11:10 2013
@@ -43,7 +43,7 @@ public abstract class AbstractTomcat7Moj
      * The webapp context path to use for the web application being run. This must always start with a forward-slash
      * ('/').
      */
-    @Parameter( defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true )
+    @Parameter(defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true)
     protected String path;
 
 
@@ -56,7 +56,8 @@ public abstract class AbstractTomcat7Moj
      * Check response of Tomcat to know if ok or not.
      *
      * @param tomcatResponse response of tomcat return by TomcatManager class
-     * @throws org.apache.maven.plugin.MojoExecutionException if HTTP status code greater than 400 (included)
+     * @throws org.apache.maven.plugin.MojoExecutionException
+     *          if HTTP status code greater than 400 (included)
      */
     protected void checkTomcatResponse( TomcatManagerResponse tomcatResponse )
         throws MojoExecutionException
@@ -65,10 +66,12 @@ public abstract class AbstractTomcat7Moj
 
         if ( statusCode >= 400 )
         {
-            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) );
+            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
+                                                         tomcatResponse.getReasonPhrase() ) );
 
             throw new MojoExecutionException(
-                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) + ": "
+                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
+                                             tomcatResponse.getReasonPhrase() ) + ": "
                     + tomcatResponse.getHttpResponseBody() );
         }
     }



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


Re: svn commit: r1519353 - 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/ tomcat7-maven-plugin/src/main/java/o...

Posted by Olivier Lamy <ol...@apache.org>.
On 3 September 2013 05:43, Konstantin Kolinko <kn...@gmail.com> wrote:
> 2013/9/2  <ol...@apache.org>:
>> Author: olamy
>> Date: Mon Sep  2 06:11:10 2013
>> New Revision: 1519353
>>
>> URL: http://svn.apache.org/r1519353
>> Log:
>> display the reason phrase too
>>
>> Modified:
>>     tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
>>     tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
>>     tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.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=1519353&r1=1519352&r2=1519353&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:11:10 2013
>> @@ -112,4 +112,4 @@ AbstractI18NTomcat6Mojo.tomcatHttStatusE
>>
>>  #AbstractTomcat7Mojo
>>
>> -AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}
>> +AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}, Reason Phrase: {1}
>
> 1. Typo in message key:
> s/ Htt / Http / ?
>
> 2. The file below references
> "AbstractI18NTomcat6Mojo.tomcatHttStatusError",
>
> but the message above is "Tomcat7" one.
> Haven't you forgotten to change "Tomcat6" message as well?

Yup I missed to move to only one key as it's the same message.
Just fixed.

Thanks for the review!

Olivier

>
> Best regards,
> Konstantin Kolinko
>
>>
>> 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=1519353&r1=1519352&r2=1519353&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:11:10 2013
>> @@ -68,10 +68,12 @@ public abstract class AbstractI18NTomcat
>>
>>          if ( statusCode >= 400 )
>>          {
>> -            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) );
>> +            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
>> +                                                         tomcatResponse.getReasonPhrase() ) );
>>
>>              throw new MojoExecutionException(
>> -                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) + ": "
>> +                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
>> +                                             tomcatResponse.getReasonPhrase() ) + ": "
>>                      + tomcatResponse.getHttpResponseBody() );
>>          }
>>      }
>>
>> Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java
>> URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java?rev=1519353&r1=1519352&r2=1519353&view=diff
>> ==============================================================================
>> --- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java (original)
>> +++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java Mon Sep  2 06:11:10 2013
>> @@ -43,7 +43,7 @@ public abstract class AbstractTomcat7Moj
>>       * The webapp context path to use for the web application being run. This must always start with a forward-slash
>>       * ('/').
>>       */
>> -    @Parameter( defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true )
>> +    @Parameter(defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true)
>>      protected String path;
>>
>>
>> @@ -56,7 +56,8 @@ public abstract class AbstractTomcat7Moj
>>       * Check response of Tomcat to know if ok or not.
>>       *
>>       * @param tomcatResponse response of tomcat return by TomcatManager class
>> -     * @throws org.apache.maven.plugin.MojoExecutionException if HTTP status code greater than 400 (included)
>> +     * @throws org.apache.maven.plugin.MojoExecutionException
>> +     *          if HTTP status code greater than 400 (included)
>>       */
>>      protected void checkTomcatResponse( TomcatManagerResponse tomcatResponse )
>>          throws MojoExecutionException
>> @@ -65,10 +66,12 @@ public abstract class AbstractTomcat7Moj
>>
>>          if ( statusCode >= 400 )
>>          {
>> -            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) );
>> +            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
>> +                                                         tomcatResponse.getReasonPhrase() ) );
>>
>>              throw new MojoExecutionException(
>> -                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) + ": "
>> +                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
>> +                                             tomcatResponse.getReasonPhrase() ) + ": "
>>                      + tomcatResponse.getHttpResponseBody() );
>>          }
>>      }
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>



-- 
Olivier Lamy
Ecetera: http://ecetera.com.au
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: svn commit: r1519353 - 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/ tomcat7-maven-plugin/src/main/java/o...

Posted by Konstantin Kolinko <kn...@gmail.com>.
2013/9/2  <ol...@apache.org>:
> Author: olamy
> Date: Mon Sep  2 06:11:10 2013
> New Revision: 1519353
>
> URL: http://svn.apache.org/r1519353
> Log:
> display the reason phrase too
>
> Modified:
>     tomcat/maven-plugin/trunk/common-tomcat-maven-plugin/src/main/resources/org/apache/tomcat/maven/common/messages/messages.properties
>     tomcat/maven-plugin/trunk/tomcat6-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat6/AbstractI18NTomcat6Mojo.java
>     tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.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=1519353&r1=1519352&r2=1519353&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:11:10 2013
> @@ -112,4 +112,4 @@ AbstractI18NTomcat6Mojo.tomcatHttStatusE
>
>  #AbstractTomcat7Mojo
>
> -AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}
> +AbstractTomcat7Mojo.tomcatHttStatusError = Tomcat return http status error: {0}, Reason Phrase: {1}

1. Typo in message key:
s/ Htt / Http / ?

2. The file below references
"AbstractI18NTomcat6Mojo.tomcatHttStatusError",

but the message above is "Tomcat7" one.
Haven't you forgotten to change "Tomcat6" message as well?

Best regards,
Konstantin Kolinko

>
> 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=1519353&r1=1519352&r2=1519353&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:11:10 2013
> @@ -68,10 +68,12 @@ public abstract class AbstractI18NTomcat
>
>          if ( statusCode >= 400 )
>          {
> -            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) );
> +            getLog().error( messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
> +                                                         tomcatResponse.getReasonPhrase() ) );
>
>              throw new MojoExecutionException(
> -                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode ) + ": "
> +                messagesProvider.getMessage( "AbstractI18NTomcat6Mojo.tomcatHttStatusError", statusCode,
> +                                             tomcatResponse.getReasonPhrase() ) + ": "
>                      + tomcatResponse.getHttpResponseBody() );
>          }
>      }
>
> Modified: tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java
> URL: http://svn.apache.org/viewvc/tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java?rev=1519353&r1=1519352&r2=1519353&view=diff
> ==============================================================================
> --- tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java (original)
> +++ tomcat/maven-plugin/trunk/tomcat7-maven-plugin/src/main/java/org/apache/tomcat/maven/plugin/tomcat7/AbstractTomcat7Mojo.java Mon Sep  2 06:11:10 2013
> @@ -43,7 +43,7 @@ public abstract class AbstractTomcat7Moj
>       * The webapp context path to use for the web application being run. This must always start with a forward-slash
>       * ('/').
>       */
> -    @Parameter( defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true )
> +    @Parameter(defaultValue = "/${project.artifactId}", property = "maven.tomcat.path", required = true)
>      protected String path;
>
>
> @@ -56,7 +56,8 @@ public abstract class AbstractTomcat7Moj
>       * Check response of Tomcat to know if ok or not.
>       *
>       * @param tomcatResponse response of tomcat return by TomcatManager class
> -     * @throws org.apache.maven.plugin.MojoExecutionException if HTTP status code greater than 400 (included)
> +     * @throws org.apache.maven.plugin.MojoExecutionException
> +     *          if HTTP status code greater than 400 (included)
>       */
>      protected void checkTomcatResponse( TomcatManagerResponse tomcatResponse )
>          throws MojoExecutionException
> @@ -65,10 +66,12 @@ public abstract class AbstractTomcat7Moj
>
>          if ( statusCode >= 400 )
>          {
> -            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) );
> +            getLog().error( messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
> +                                                         tomcatResponse.getReasonPhrase() ) );
>
>              throw new MojoExecutionException(
> -                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode ) + ": "
> +                messagesProvider.getMessage( "AbstractTomcat7Mojo.tomcatHttStatusError", statusCode,
> +                                             tomcatResponse.getReasonPhrase() ) + ": "
>                      + tomcatResponse.getHttpResponseBody() );
>          }
>      }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>

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