Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jar task does not generate manifest #360

Closed
instilled opened this issue Dec 17, 2015 · 1 comment
Closed

jar task does not generate manifest #360

instilled opened this issue Dec 17, 2015 · 1 comment
Labels

Comments

@instilled
Copy link
Contributor

Hi,

I've been experimenting with uber and jar tasks in boot. It seems to me that META-INF/MANIFEST.MF may get overwritten if one already exists in the file-set in the jar task. This may happen if a library provides a manifest and is exploded in the uber task.

Example bulid.boot:

...
(deftask standalone
  "Build selfcontained, executable jar."
  []
  (comp
   (pom)
   (javac)
   (aot :namespace '#{my.ns})
   (uber :exclude #{#"(?i)meta-inf/.*\.(SF|DSA|RSA)"
                              #".*/test/.*"}))
   (jar :main 'my.ns.main)))
...

Running boot standalone I would expect a manifest entry with only the required properties, i.e Manifest-Version: ... and Main-Class: my.ns.main. But that does not happen if I depend on a library with existing Manifest. I assume this is due to how update-jar#L74 works:

(defn update-jar!
  [jarfile old-fs new-fs attr main]
  (with-open [fs (fs/mkjarfs jarfile)]
    (fs/write! fs (create-manifest main attr) (io/file "META-INF" "MANIFEST.MF"))
    (fs/patch! fs old-fs new-fs)))

shouldn't it be:

(defn update-jar!
  [jarfile old-fs new-fs attr main]
  (with-open [fs (fs/mkjarfs jarfile)]
    ;; lines swapped
    (fs/patch! fs old-fs new-fs))
    (fs/write! fs (create-manifest main attr) (io/file "META-INF" "MANIFEST.MF")))

If that's really the issue I'll happily provide a pull request.

Fabio

@micha
Copy link
Contributor

micha commented Dec 17, 2015

@instilled Thanks for reporting the issue, and for taking the time to investigate. This is a bug, exactly as you describe. I'll add your fix to the 2.5.1 release we'll do today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants