Fork me on GitHub
#leiningen
<
2023-02-17
>
kennytilton18:02:41

So I am getting ready to release a new web library and thought it would be super-nice to include a leiningen template. And I am delighted to see how straighforward it seems! https://cljdoc.org/d/leiningen/leiningen/2.9.8/doc/writing-templates I looked a couple of years ago and it was quite daunting. Maybe I looked in the wrong place. Anyway, great! I am working thru the instructions and hit my first speed bump. The doc says:

While developing a template, if you're in the template project directory, leiningen will pick it up and you'll be able to test it. e.g. from the liquid-cool-template dir:

$ lein new us.technomancy/liquid-cool myproject
will create a directory called myproject, built from your template. 
Maybe I do not understabd "in the template project directory"? I think I am, but I get
~/dev/web-mx-template  $ lein new com.tiltontec/web-mx myproject
Failed to resolve version for com.tiltontec:lein-template.web-mx:jar:RELEASE: Could not find metadata com.tiltontec:lein-template.web-mx/maven-metadata.xml in local (/Users/kennethtilton/.m2/repository)
Failed to read artifact descriptor for com.tiltontec:lein-template.web-mx:jar:RELEASE
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template for com.tiltontec/web-mx on the classpath:  leiningen.new.web-mx
I see I can also do lein install, but I want to understand why this does not work first, and installing will mask that. Any ideas welcome! 🙏

👍 4
kennytilton19:02:48

I broke down and installed:

~/dev/web-mx-template  $ lein install
Created /Users/kennethtilton/dev/web-mx-template/target/lein-template.web-mx-0.1.0-SNAPSHOT.jar
Wrote /Users/kennethtilton/dev/web-mx-template/pom.xml
Installed jar and pom into local repo.
~/dev/web-mx-template  $ u                                                      
~/dev  $ lein new com.tiltontec/web-mx temp-wmx
Failed to resolve version for com.tiltontec:lein-template.web-mx:jar:RELEASE
Failed to read artifact descriptor for com.tiltontec:lein-template.web-mx:jar:RELEASE
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template for com.tiltontec/web-mx on the classpath:  leiningen.new.web-mx
And a desperation stab:
~/dev  $ lein new com.tiltontec/web-mx-template temp-wmx
Failed to resolve version for com.tiltontec:lein-template.web-mx-template:jar:RELEASE: Could not find metadata com.tiltontec:lein-template.web-mx-template/maven-metadata.xml in local (/Users/kennethtilton/.m2/repository)
Failed to read artifact descriptor for com.tiltontec:lein-template.web-mx-template:jar:RELEASE
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template for com.tiltontec/web-mx-template on the classpath:  leiningen.new.web-mx-template
~/dev  $ lein version
Leiningen 2.10.0 on Java 11.0.9.1 OpenJDK 64-Bit Server VM
Looking forward to getting this going!