boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 181 forks source link

Write manifest file first in update-jar! #716

Closed RadicalZephyr closed 4 years ago

RadicalZephyr commented 5 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.

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.