This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/maven-remote-resources-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 7530d61  add template name on Velocity rendering error
7530d61 is described below

commit 7530d6134784a0fe0941cb485374845e44a28619
Author: HervĂ© Boutemy <[email protected]>
AuthorDate: Sun Sep 16 19:17:15 2018 +0200

    add template name on Velocity rendering error
---
 .../maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
 
b/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
index d105244..de501d0 100644
--- 
a/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
+++ 
b/src/main/java/org/apache/maven/plugin/resources/remote/ProcessRemoteResourcesMojo.java
@@ -94,6 +94,7 @@ import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.exception.MethodInvocationException;
 import org.apache.velocity.exception.ParseErrorException;
 import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.exception.VelocityException;
 import org.apache.velocity.runtime.RuntimeServices;
 import org.apache.velocity.runtime.log.LogChute;
 import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
@@ -1151,6 +1152,7 @@ public class ProcessRemoteResourcesMojo
     protected void processResourceBundles( RemoteResourcesClassLoader 
classLoader, VelocityContext context )
         throws MojoExecutionException
     {
+        String velocityResource = null;
         try
         {
             // CHECKSTYLE_OFF: LineLength
@@ -1181,6 +1183,7 @@ public class ProcessRemoteResourcesMojo
                         if ( projectResource.endsWith( TEMPLATE_SUFFIX ) )
                         {
                             projectResource = projectResource.substring( 0, 
projectResource.length() - 3 );
+                            velocityResource = bundleResource;
                             doVelocity = true;
                         }
 
@@ -1283,9 +1286,9 @@ public class ProcessRemoteResourcesMojo
         {
             throw new MojoExecutionException( "Error parsing remote resource 
bundle descriptor.", e );
         }
-        catch ( Exception e )
+        catch ( VelocityException e )
         {
-            throw new MojoExecutionException( "Error rendering velocity 
resource.", e );
+            throw new MojoExecutionException( "Error rendering Velocity 
resource '" + velocityResource + "'", e );
         }
     }
 

Reply via email to