[MSHADE-278] - Print out the jar responsible for exceptions
authorKarl Heinz Marbaise <khmarbaise@apache.org>
Mon, 2 Apr 2018 16:23:39 +0000 (18:23 +0200)
committerKarl Heinz Marbaise <khmarbaise@apache.org>
Mon, 2 Apr 2018 17:41:41 +0000 (19:41 +0200)
 o like "Error creating shaded jar: invalid LOC header (bad signature)"
   improvement by Gary Gregory

src/main/java/org/apache/maven/plugins/shade/DefaultShader.java

index ec1fb96..ee633f8 100644 (file)
@@ -187,8 +187,16 @@ public class DefaultShader
 
                     if ( !entry.isDirectory() && !isFiltered( jarFilters, name ) )
                     {
-                        shadeSingleJar( shadeRequest, resources, transformers, remapper, jos, duplicates, jar, jarFile,
-                                        entry, name );
+                        try
+                        {
+                            shadeSingleJar( shadeRequest, resources, transformers, remapper, jos, duplicates, jar,
+                                            jarFile, entry, name );
+                        }
+                        catch ( Exception e )
+                        {
+                            throw new IOException( String.format( "Problem shading JAR %s entry %s: %s", jar, name, e ),
+                                                   e );
+                        }
                     }
                 }