Index: src/test/java/org/apache/maven/shared/jar/JarAnalyzerTest.java
===================================================================
--- src/test/java/org/apache/maven/shared/jar/JarAnalyzerTest.java	(revision 807810)
+++ src/test/java/org/apache/maven/shared/jar/JarAnalyzerTest.java	(working copy)
@@ -2,7 +2,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.zip.ZipException;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -78,7 +77,7 @@
             jarAnalyzer = new JarAnalyzer( new File( "foo-bar.jar" ) );
             fail( "Should not have succeeded to get the missing JAR" );
         }
-        catch ( ZipException e )
+        catch ( IOException e )
         {
             assertTrue( true );
         }
@@ -92,11 +91,25 @@
             getJarAnalyzer( "invalid.jar" );
             fail( "Should not have succeeded to get the invalid JAR" );
         }
-        catch ( ZipException e )
+        catch ( IOException e )
         {
             assertTrue( true );
         }
     }
+    
+    public void testPathnameInExceptionMessage() 
+        throws Exception
+    {
+        try
+        {
+            getJarAnalyzer( "invalid.jar" );
+            fail( "Should not have succeeded to get the invalid JAR" );
+        }
+        catch ( IOException e )
+        {
+            assertTrue( e.getMessage().contains( "invalid.jar" ) );
+        }
+    }
 
     public void testCloseTwice()
         throws Exception
Index: src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java
===================================================================
--- src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java	(revision 807810)
+++ src/main/java/org/apache/maven/shared/jar/JarAnalyzer.java	(working copy)
@@ -99,34 +99,35 @@
     public JarAnalyzer( File file )
         throws IOException
     {
-        this.jarFile = new JarFile( file );
+        try
+        {
+            this.jarFile = new JarFile( file );
 
-        // Obtain entries list.
-        List entries = Collections.list( jarFile.entries() );
+            // Obtain entries list.
+            List entries = Collections.list( jarFile.entries() );
 
-        // Sorting of list is done by name to ensure a bytecode hash is always consistent.
-        Collections.sort( entries, new Comparator()
-        {
-            public int compare( Object o1, Object o2 )
+            // Sorting of list is done by name to ensure a bytecode hash is always consistent.
+            Collections.sort( entries, new Comparator()
             {
-                JarEntry entry1 = (JarEntry) o1;
-                JarEntry entry2 = (JarEntry) o2;
+                    public int compare( Object o1, Object o2 )
+                    {
+                        JarEntry entry1 = (JarEntry) o1;
+                        JarEntry entry2 = (JarEntry) o2;
 
-                return entry1.getName().compareTo( entry2.getName() );
-            }
-        } );
+                        return entry1.getName().compareTo( entry2.getName() );
+                    }
+                });
 
-        Manifest manifest;
-        try
-        {
+            Manifest manifest;
             manifest = jarFile.getManifest();
+
+            this.jarData = new JarData( file, manifest, entries );
         }
         catch ( IOException e )
         {
             closeQuietly();
-            throw e;
+            throw new IOException( "failed to read " + file.getAbsolutePath(), e );
         }
-        this.jarData = new JarData( file, manifest, entries );
     }
 
     /**
@@ -150,7 +151,10 @@
     {
         try
         {
-            jarFile.close();
+            if( jarFile != null )
+            {
+                jarFile.close();
+            }
         }
         catch ( IOException e )
         {
