Fork me on GitHub
#tools-deps
<
2018-09-27
>
tianshu07:09:34

when try to uberjar, meet this error

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact org.quartz-scheduler:quartz-parent:pom:2.3.0 in terracotta-snapshots ()
This dependency, will be handled correct when using leiningen. I don't know how to investigate the issue, where should I start?

dominicm12:09:39

This looks like TDEPS-50 also?

orestis13:09:35

Is there a tools.deps friendly way to run Eastwood from the command line?

orestis14:09:43

Also, what is a no-fuss way to build an uberjar for a deps.edn project? I tried pack.alpha, depstar so far and I get weird errors.

orestis14:09:22

depstar: I get this issue: https://github.com/healthfinch/depstar/issues/5, too much fuss to do manifests etc.

orestis14:09:12

pack.alpha:

NOTE: /alpha/bootstrap/onejar/src/com/simontuffs/onejar/JarClassLoader.java, line -1: Some input files use unchecked or unsafe operations.

NOTE: /alpha/bootstrap/onejar/src/com/simontuffs/onejar/JarClassLoader.java, line -1: Recompile with -Xlint:unchecked for details.

~/d/n/c/october (master|✚1…) $ java -jar output.jar
Exception in thread "main" java.lang.ClassNotFoundException: clojure.main
	at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:713)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at com.simontuffs.onejar.JarClassLoader.loadClass(JarClassLoader.java:630)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.simontuffs.onejar.Boot.run(Boot.java:336)
	at com.simontuffs.onejar.Boot.main(Boot.java:168)

seancorfield16:09:11

@orestis For pack.alpha, that seems to indicate it didn't include the Clojure runtime -- no idea about that since I haven't tried it but @U09LZR36F (the author) is very helpful. For depstar, adding the manifest manually is an easy step and I like the raw simplicity of it. Haven't tried cambada so thanks for finding that and posting the link!

orestis16:09:53

It’s up on the tools.deps wiki and has a very good README :)

seancorfield16:09:27

Yeah, just looking it over. Very nice!

dominicm16:09:31

I think the pack bug would be fixed by using the latest version.

dominicm16:09:41

I haven't updated the installer, and I should!

orestis14:09:54

Hooray - https://github.com/luchiniatwork/cambada seems to work out of the box, with the only addition being an extra command-line parameter to specify the main namespace

andy.fingerhut16:09:20

I do not have a tools.deps friendly way handy and worked out for running Eastwood from the command line, but if you look at this section of the Eastwood docs on how you can do it from the REPL, without Leiningen involved, you or someone better at tools.deps knowledge than I might be able to figure it out. I'd be happy to add a note like that to the Eastwood README if it isn't too difficult to explain: https://github.com/jonase/eastwood#running-eastwood-in-a-repl

andy.fingerhut16:09:58

Warning: The latest Eastwood 0.2.9 release has a bug in which when you try to use it, it will download (if you don't already have it) and use Eastwood 0.2.8 instead. You may want to simply specify Eastwood 0.2.8 for now, since that is what you will end up using anyway.

seancorfield16:09:44

@orestis

clj -Sdeps '{:deps {jonase/eastwood {:mvn/version "0.2.8"}}}' -e "(require '[eastwood.lint :as e])" -e '(e/eastwood {:source-paths ["src"] :test-paths ["test"]})'

seancorfield16:09:14

You could squirrel most of that away in your ~/.clojure/deps.edn file as an alias...

seancorfield16:09:59

:eastwood {:extra-deps {jonase/eastwood {:mvn/version "0.2.8"}}
             :main-opts ["-e" "(require,'[eastwood.lint,:as,e])"
                         "-e" "(e/eastwood,{:source-paths,[\"src\"],:test-paths,[\"test\"]})"]}
(note that you need , instead of space!)

orestis18:09:41

I ended up doing this:

:eastwood {:extra-deps {jonase/eastwood {:mvn/version "0.2.8"}}
             :main-opts ["-m" "eastwood.runner"]
             :extra-paths ["test" "tools"]}
And I made a tools directory to contain simple namespaces like that. In this case:
(ns eastwood.runner
  (:require [eastwood.lint :as e]))

(defn -main [& args]
  (e/eastwood {:source-paths ["src"] :test-paths ["test"]}))

seancorfield18:09:16

Oh, that's nice! :thumbsup::skin-tone-2:

orestis17:09:46

Yeah, I saw that trick on your dot-Clojure and was about to ask! Is that a known bug?

orestis17:09:07

I guess though I can just as easily make a tiny namespace to do this.

seancorfield17:09:19

@orestis It's to do with how the strings are run through the clojure shell script and into the main opts cache file and then read back. So, yeah, it's a "known feature" 🙂

orestis17:09:54

Right, so it’s not going away any time soon I guess?

orestis17:09:50

I remember some mentions of caching compiled dependencies to speed up startup time - any ideas about that?

orestis17:09:45

More questions - in deps.edn, can you actually override the entire top-level deps entry? Or can you only append?

orestis17:09:45

Rationale: most of my aliases so far have to do with running lint tools, packaging, test runners etc. These namespaces have no need to access my actual app’s classpath. I guess there has bound to be some overhead when the class path is unnecessarily large?

orestis17:09:08

I know that clj will cache the classpath and it’s actually very noticeable.