Welcome! Please see the About page for a little more info on how this works.

0 votes
in tools.build by


I have been trying to build an uberjar using tools.deps and I encountered the following exception:

Execution error (ZipException) at java.util.zip.ZipOutputStream/putNextEntry (ZipOutputStream.java:233).
duplicate entry: META-INF/MANIFEST.MF

This is because one library appears to provides a META-INF/MANIFEST.MF that conflicts with the one clojure.tools.build.api/uber is trying to add in the uberjar.

I guess such file should be ignored by default for example by defining clojure.tools.build.tasks.uber/uber-exclusions like this:

(def ^:private uber-exclusions

I don't have access to Clojure JIRA but If somebody give me access I am willing to provide a trivial patch containing this fix and a test case for the specific MANIFEST.MF exclusion.

2 Answers

0 votes

Fixed in v0.1.3, thanks.

0 votes

depstar has drop-in replacements for tools.build's jar and uber functions that handle merging of LICENSE files, a bunch more exclusions, merging log4j2 plugin caches, etc. See https://github.com/seancorfield/depstar/blob/develop/src/hf/depstar/api.clj

Right now you'd have to depend on HEAD via :git/url as I'm reworking all the documentation before I cut the next release, but I'd be interested in feedback if you're willing to try it out.

See the example https://github.com/seancorfield/depstar/blob/develop/build.clj which is the tools.build examples with depstar's versions of jar and uber swapped in.

Version 2.1.267 of depstar is available with all the updated docs: https://cljdoc.org/d/com.github.seancorfield/depstar/2.1.267/doc/tools-build-usage
Even if you already released the new version, I can confirm that depstar worked as intended when building an uberjar for my project.
Good to know, thanks!