akhikhl / wuff

Gradle plugin for automating assembly of OSGi/Eclipse bundles and applications
MIT License
152 stars 51 forks source link

ManifestUtils.loadManifest returns a default manifest upon absence #91

Open hintzed opened 9 years ago

hintzed commented 9 years ago

I think there is currently a bug in ManifestUtils.loadManifest when it comes to jars without META-INF/MANIFEST.MF (for instance 'javax.inject:javax.inject:1'), as the method apparently always expects to find a manifest file. Since each call of loadManifest also replaces a previous temp file, a missing manifest file might actually get replaced by the still present manifest from the previous call (hence usually from another library), thus returning the wrong manifest, leading to strange effects.

I propose to fix this by deleting the temp manifest file after reading it as well as by returning a default manifest in case the library did not contain an initial manifest.