Fork me on GitHub

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

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:
what does this mean, why a lein-template and boot-template is needed?


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


which is obviously bogus


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.


I give it the wrong template path


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.


(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)


thanks for the explain!


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.


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


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!


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