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

uberjar fails when using git libs #9

Open
xfthhxk opened this issue Oct 1, 2018 · 1 comment
Open

uberjar fails when using git libs #9

xfthhxk opened this issue Oct 1, 2018 · 1 comment

Comments

@xfthhxk
Copy link
Contributor

xfthhxk commented Oct 1, 2018

If deps.edn has a :git/url or :local/root such as the following then there is an exception thrown by ZipFile.open while generating the uberjar.

{:paths ["src" "resources"]
 :deps
  {commons   {:git/url "https://github.com/user/commons"
              :sha "caffa137fa1c865ee12f02ed100f11917e839c11"}}
 :aliases
 {:uberjar {:extra-deps
            {luchiniatwork/cambada {:mvn/version "1.0.0"}}
            :main-opts ["-m" "cambada.uberjar" "--main" "program.main"]}}
 ...
  Including httpcore-nio-4.4.6.jar
  Including component-0.3.2.jar
  Including clj
Exception in thread "main" java.io.FileNotFoundException: /home/user/.gitlibs/libs/commons/caffa137fa1c865ee12f02ed100f11917e839c11/src/clj (Is a directory)
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:225)
	at java.util.zip.ZipFile.<init>(ZipFile.java:155)
	at java.util.zip.ZipFile.<init>(ZipFile.java:169)
	at sun.reflect.GeneratedConstructorAccessor15.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at clojure.lang.Reflector.invokeConstructor(Reflector.java:180)
	at cambada.uberjar$include_dep.invokeStatic(uberjar.clj:103)
	at cambada.uberjar$include_dep.invoke(uberjar.clj:102)
	at clojure.core$partial$fn__5563.invoke(core.clj:2624)
	at clojure.core.protocols$naive_seq_reduce.invokeStatic(protocols.clj:62)
	at clojure.core.protocols$interface_or_naive_reduce.invokeStatic(protocols.clj:72)
	at clojure.core.protocols$fn__7852.invokeStatic(protocols.clj:169)
	at clojure.core.protocols$fn__7852.invoke(protocols.clj:124)
	at clojure.core.protocols$fn__7807$G__7802__7816.invoke(protocols.clj:19)
	at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
	at clojure.core.protocols$fn__7835.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__7835.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__7781$G__7776__7794.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6748)
	at clojure.core$reduce.invoke(core.clj:6730)
	at cambada.uberjar$write_components.invokeStatic(uberjar.clj:118)
	at cambada.uberjar$write_components.invoke(uberjar.clj:113)
	at cambada.uberjar$apply_BANG_.invokeStatic(uberjar.clj:138)
	at cambada.uberjar$apply_BANG_.invoke(uberjar.clj:129)
	at cambada.cli$runner.invokeStatic(cli.clj:120)
	at cambada.cli$runner.invoke(cli.clj:115)
	at cambada.uberjar$_main.invokeStatic(uberjar.clj:142)
	at cambada.uberjar$_main.doInvoke(uberjar.clj:140)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.core$apply.invokeStatic(core.clj:657)
	at clojure.main$main_opt.invokeStatic(main.clj:317)
	at clojure.main$main_opt.invoke(main.clj:313)
	at clojure.main$main.invokeStatic(main.clj:424)
	at clojure.main$main.doInvoke(main.clj:387)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:702)
	at clojure.main.main(main.java:37)
mdiin added a commit to mdiin/cambada that referenced this issue Mar 22, 2019
* filter on :mvn manifest when getting dep jars to fix luchiniatwork#9

* uberjar-exclusions to fix luchiniatwork#11

* use merged deps config by default, optionally specify --no-merge-config

* copy resource (non-source) files from gitlib/local deps for uberjar

* get deps and jar paths in one go

* write project pom.properties as lein does
@aviflax
Copy link

aviflax commented Sep 24, 2019

I bumped into this recently and asked about it in Clojurians. Someone recommended I try this fork of Cambada and it did indeed resolve the problem for me.

alza-bitz added a commit to digital-dj-tools/dj-data-converter that referenced this issue Jul 29, 2020
Investigation to determine if GraalVM can be used to fix #33.
So that Clojure/Java impl of data.xml is used instead of ClojureScript.

Using Clojure 1.10.2-alpha1 and spec-tools 0.10.0
Using xfthhxk fix for luchiniatwork/cambada#9
Working for files that don't exist (Traktor to Rekordbox)
Error for files that exist, from mp3-parser (Traktor to Rekordbox)
Error for all files? (Rekordbox to Traktor)
alza-bitz added a commit to digital-dj-tools/dj-data-converter that referenced this issue Nov 3, 2020
* Partially working GraalVM native image

Investigation to determine if GraalVM can be used to fix #33.
So that Clojure/Java impl of data.xml is used instead of ClojureScript.

Using Clojure 1.10.2-alpha1 and spec-tools 0.10.0
Using xfthhxk fix for luchiniatwork/cambada#9
Working for files that don't exist (Traktor to Rekordbox)
Error for files that exist, from mp3-parser (Traktor to Rekordbox)
Error for all files? (Rekordbox to Traktor)

* ClojureScript tests passing again

* Partially working GraalVM native image

Investigation to determine if GraalVM can be used to fix #33.
Now working for files that exist (Traktor to Rekordbox)
Fixed error from mp3-parser

* Partially working GraalVM native image

Investigation to determine if GraalVM can be used to fix #33.
Now working for all files (Rekordbox to Traktor)

* Add clojure setup to build job steps

* Add native-image-linux job

Use Java 11 instead of Java 8

* Use sudo where needed

* Graalvm Native Image for Windows (#35)

* Add native-image-windows job

Doesn't build the native image yet
Need to determine installation directory first

* Reorganised to create an uberjar in the first step

The Clojure setup action doesn't work on Windows;
This is an experiment to just use GraalVM Native image directly instead

* Enable verbose output to determine paths

* Debugging

* Fixed name argument

* Add --initialize-at-build-time option

* No target directory

* Add steps to native-image-windows job

* Install Visual C Build Tools Workload

For Visual Studio 2017

* Changes for Powershell

* Use cmd instead of Powershell

* Add package and publish steps

* Debugging

* Fixed GraalVM image name

* Additional smoke tests

* Don't use direct linking

It causes java.lang.ClassNotFoundException: clojure.data.xml$parse

* Add native-image-macos job (#37)

* Add release job

* Update clojurescript dep to 1.10.773

Avoid error running uberjar alias
Execution error (ExceptionInfo) at clojure.tools.deps.alpha.extensions.maven/get-artifact (maven.clj:118).
Could not find artifact org.clojure:tools.reader:jar:1.3.0
Separate job for running tests
Add support for skipping builds

* Add status badge for GitHub Actions

* Reverted from fork back to juxt repo for tick dep

Also removed js-joda ns, no longer required with latest tick version

* Update mp3-parser dep to 0.2.0

* Add link to status badge

* Remove Azure Pipelines definition

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

No branches or pull requests

2 participants