Fork me on GitHub
#tools-build
<
2023-04-06
>
Bastian15:04:13

Hi! I'm getting an exception when building an uber jar in windows using the default conflict handler (:append-dedupe) for LICENSE files, also with :append. It works well :warn. Here is the error message: Execution error (FileNotFoundException) at http://java.io.FileOutputStream/open0 (FileOutputStream.java:-2). C:\Users\B\AppData\Local\Temp\uber11859840574852522667\LICENSE (Zugriff verweigert) Zugriff verweigert = Access Denied (I also tried it with adminstrator privileges, so this does not seem the problem) I am using io.github.clojure/tools.build {:git/tag "v0.9.4" :git/sha "76b78fe"} Thanks for any ideas.

borkdude15:04:58

@U04TQR7C24D After this failure, does C:\Users\B\AppData\Local\Temp\uber11859840574852522667\LICENSE exist on disk?

seancorfield15:04:34

It's most likely due to one dependency jar having a file called license and one having a directory called license. The solution is to add an exclusion on license. This comes up fairly often here so you should be able to search this channel for license to find details (I'm in my phone right now).

👍 2
Bastian16:04:35

thanks for your fast answers! I'll look through the channel. I am fairly new to clojure and it cost me some time to even figure out the conflict handler as a culprit, would be nice to have a more verbose error message 🙂 (the file does not exist after building)

seancorfield16:04:03

This conflict happens less on Linux because the directory tends to be license and the file tends to be LICENSE, but it can happen easily on macOS/Windows where the filesystem is not case-sensitive. I'm at my desk now so if you're still looking for the exact config needed, I can probably find it pretty quickly now... 🙂

👍 2
Bastian16:04:07

i found it, thanks again for your time!

2
seancorfield16:04:26

Uberjar building OK now?

Bastian16:04:35

yes, using :exclude with a regex matching the LICENSE worked.

🎉 2
Bastian16:04:58

small steps 🙂