Closed RadicalZephyr closed 4 years ago
It appears to be a de facto standard for the meta-inf directory and the manifest.mf file to be the first and second entries in the jar file.
There is no mention of ordering in the jar specification, but it appears that most tools create Jar files with the manifest file as the first entry by using this JarOutputStream constructor. In addition the complementary jar reading code in JarInputStream explicitly states that it assumes the first few entries contain the manifest file.
JarOutputStream
JarInputStream
At least one other tool is known to rely on this detail of jar file ordering.
While it may not be necessary according to the spec, it seems reasonable to follow this fairly standard ecosystem behavior.
This fixes #710.
It appears to be a de facto standard for the meta-inf directory and the manifest.mf file to be the first and second entries in the jar file.
There is no mention of ordering in the jar specification, but it appears that most tools create Jar files with the manifest file as the first entry by using this
JarOutputStream
constructor. In addition the complementary jar reading code inJarInputStream
explicitly states that it assumes the first few entries contain the manifest file.At least one other tool is known to rely on this detail of jar file ordering.
While it may not be necessary according to the spec, it seems reasonable to follow this fairly standard ecosystem behavior.
This fixes #710.