ali-rezvani / onejar-maven-plugin

Maven onejar plugin
0 stars 0 forks source link

NullPointerException thrown trying to access MANIFEST.MF of embedded jars #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

        Enumeration<URL> mfs = classLoader.getResources(JarFile.MANIFEST_NAME);

        while (mfs.hasMoreElements()) {
            URL u = mfs.nextElement();
            Manifest mf = new Manifest(u.openStream());
            processJarFile(mf);
        }

Try to access the MANIFEST.MF file when one of the embedded jars does not have 
the MANIFEST.MF entry as the 1st or 2nd entry in the jar.  Like aspectjrt 

What is the expected output? What do you see instead?

Caused by: java.lang.NullPointerException
    at com.simontuffs.onejar.OneJarFile.getInputStream(OneJarFile.java:116)
    at com.simontuffs.onejar.OneJarURLConnection.getInputStream(OneJarURLConnection.java:51)
    at java.net.URL.openStream(URL.java:1037)

What version of onejar-maven-plugin are you using?

1.4.4

What is the output of "mvn -version" on your machine?
3.2.3

Please provide any additional information below.

Original issue reported on code.google.com by kcham...@cisco.com on 3 Nov 2014 at 9:15