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

onejar build doesn't include compiled assets #105

Open
snichme opened this issue Aug 12, 2019 · 4 comments
Open

onejar build doesn't include compiled assets #105

snichme opened this issue Aug 12, 2019 · 4 comments

Comments

@snichme
Copy link
Contributor

snichme commented Aug 12, 2019

I'm trying out edge and I want to use it with clojurescript.
The development part is all working without any issues but when I try to build a production jar, the jar doesn't include the js nor css files. Or at least the requests fails.

I produce the jar by running

../bin/onejar -A:prod --args '-m edge.main' project.jar

and when run the jar I get a 500 for the css file and a 404 for the js file.

Stacktraces:
For the js file:

clojure.lang.ExceptionInfo:  {:status 404}
	at yada.methods$eval21592$fn__21593.invoke(methods.clj:146)
	at yada.methods$eval21561$fn__21562$G__21552__21569.invoke(methods.clj:132)
	at yada.methods$eval21605$fn__21612$fn__21621.invoke(methods.clj:188)
	at manifold.deferred$eval3327$chain___3348.invoke(deferred.clj:862)
	at clojure.lang.AFn.applyToHelper(AFn.java:165)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:660)
	at manifold.deferred$eval3327$chain___3348$fn__3352.invoke(deferred.clj:888)
	at manifold.deferred.Listener.onSuccess(deferred.clj:219)
	at manifold.deferred.Deferred$fn__3126.invoke(deferred.clj:381)
	at clojure.lang.AFn.run(AFn.java:22)
	at io.aleph.dirigiste.Executor$Worker$1.run(Executor.java:62)
	at manifold.executor$thread_factory$reify__2505$f__2506.invoke(executor.clj:44)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.Thread.run(Thread.java:835)

For the css file:

java.lang.IllegalArgumentException: No matching clause: onejar
	at yada.resources.resources_resource$new_resources_resource$file_of_resource__28769.invoke(resources_resource.clj:13)
	at yada.resources.resources_resource$new_resources_resource$fn__28772.invoke(resources_resource.clj:23)
	at yada.interceptors$get_properties.invokeStatic(interceptors.clj:112)
	at yada.interceptors$get_properties.invoke(interceptors.clj:109)
	at manifold.deferred$eval3327$chain___3348.invoke(deferred.clj:862)
	at manifold.deferred$eval3327$chain___3348.doInvoke(deferred.clj:883)
	at clojure.lang.RestFn.applyTo(RestFn.java:151)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$apply.invoke(core.clj:660)
	at manifold.deferred$eval3327$chain___3348$fn__3352.invoke(deferred.clj:888)
	at manifold.deferred.Listener.onSuccess(deferred.clj:219)
	at manifold.deferred.Deferred$fn__3126.invoke(deferred.clj:381)
	at clojure.lang.AFn.run(AFn.java:22)
	at io.aleph.dirigiste.Executor$Worker$1.run(Executor.java:62)
	at manifold.executor$thread_factory$reify__2505$f__2506.invoke(executor.clj:44)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.Thread.run(Thread.java:835)
yada by JUXT

I get the same result by generating a new app with --cljs and build a production artifact directly without any changes, I'm on commit 1d760f4

What am I missing?

@armincerf
Copy link
Member

Make sure you've ran clojure -A:build:build/once so that kick compiles everything.

Also I always use capsule over onejar (although not entirely sure of the difference). We usually end up with a jar-building script that looks something like this:

#!/bin/sh

clojure -A:build:build/once
../bin/capsule -m edge.main -e 'target/prod' -A:prod project.jar

@SevereOverfl0w can probably chime in with some more helpful feedback but hopefully that will get you going

@snichme
Copy link
Contributor Author

snichme commented Aug 12, 2019

Hi,

Thank you very much, using your script compiles everything and the jar includes the assets.
Not sure why capsule works but not the onejar one.

Will continue by using your script.

@snichme snichme closed this as completed Aug 12, 2019
@snichme
Copy link
Contributor Author

snichme commented Aug 12, 2019

PR for the docs here: #106

@SevereOverfl0w
Copy link
Contributor

Reopening because I think there's an underlying issue here, probably with a double // which java handles differently to onejar's loader.

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

3 participants