Fork me on GitHub
#tools-deps
<
2019-09-07
>
seancorfield02:09:02

seancorfield/depstar "0.3.3" is available -- no longer uses clojure.xml so you won't get "Illegal Reflective Access" warnings on JDK11 any more!

❤️ 8
tianshu18:09:59

I'm trying to create my own clj project template using clj-new. when using it, there's an error:

Failed with: Failed to resolve version for :home/tianshu/develop/ministack/lein-template:jar:RELEASE: Could not find metadata :home/tianshu/develop/ministack/lein-template/maven-metadata.xml in local (/home/tianshu/.m2/repository)
Execution error (ExceptionInfo) at clj-new.helpers/resolve-remote-template (helpers.clj:148).
Could not load artifact for template: /home/tianshu/develop/ministack
	Tried coordinates:
		[/home/tianshu/develop/ministack/boot-template "RELEASE"]
		[/home/tianshu/develop/ministack/lein-template "RELEASE"]

Full report at:
/tmp/clojure-14768781517611096608.edn
what does this mean, why a lein-template and boot-template is needed?

hiredman18:09:46

you are somehow declaring a maven dependency with a group-id of /home/tianshu/develop/ministack/ and an artifact-id of lein-template

hiredman18:09:54

which is obviously bogus

tianshu18:09:11

But it is said I should use qualified symbol or multi-segment clojure symbols. Project names must be valid qualified or multi-segment Clojure symbols.

tianshu18:09:30

I give it the wrong template path

seancorfield18:09:17

clj-new looks for a clj template, then a boot template, then a lein template -- so you can use it to create projects with other tools' templates.

seancorfield18:09:23

(it's based on boot-new which looks for a boot template, then a lein template -- and I based that library in turn on the innards of lein new, and in fact both boot-new and clj-new include some Leiningen code, with permission)

tianshu18:09:00

thanks for the explain!

seancorfield18:09:05

The idea behind "Project names must be valid qualified or multi-segment Clojure symbols." is to avoid the everything.core default that Leiningen (and Boot) fall back on if you provide a single segment name.

seancorfield18:09:09

For qualified names, it sort of expects you to use something relatively unique like your GitHub username when creating a project: clj -A:new some-template tianshu/example which will create a folder called example but the main namespace in that project would be tianshu.example

seancorfield18:09:34

Of course you can just go ahead and produce the same thing as Leiningen: clj -A:new some-template example.core 🙂 The folder will be example.core but the main ns will be example.core from src/example/core.clj ... ugh!

seancorfield18:09:23

And finally if you combine them: clj -A:new app tianshu/example.core you'll get a top-level example.core project folder with src/tianshu/example/core.clj for a main ns of tianshu.example.core