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

Lein new doesn't use installed snapshot templates (and fails to retrieve from Clojars if present) #1235

Closed
avescodes opened this issue Jun 21, 2013 · 7 comments

Comments

@avescodes
Copy link

Hey there. Folks on this pedestal-dev thread (and myself) have run into a rather interesting set of circumstances that seem to force leiningen to not use a SNAPSHOT template dependency that exists in the local maven repository and fail to fetch that dependency from Clojars if it was installed via lein sub install.

Steps to reproduce:

  • Remove any existing pedestal templates rm -rf ~/.m2/repository/pedestal-*

  • lein new pedestal-service delete-me

    • This should retrieve the template from Clojars
  • Remove pedestal templates again rm -rf ~/.m2/repository/pedestal-*

  • Clone pedestal and lein sub install from inside the repository

  • lein new pedestal-service delete-me

    ▸ lein new pedestal-service delete-me                                                                                                             
    Failed to resolve version for pedestal-service:lein-template:jar:RELEASE
    This could be due to a typo in :dependencies or network issues.
    Could not find template pedestal-service on the classpath.
    
@kasterma
Copy link

I had an issue with using a template that worked just fine in the previous leinigen version; after the above I removed the SNAPSHOT from the project.clj and the template works fine. I.e. I can confirm the reported behavior. I'll be happy to answer any questions about my setup if needed.

avescodes pushed a commit to pedestal/pedestal that referenced this issue Jul 5, 2013
Due to some weirdness with service-template tests constantly failing on
Travis (likely on account of technomancy/leiningen#1235) I've decided to
*not* run those tests there and stop hemorrhaging time trying to fix it.

I think this is an acceptable risk to take because service-template is a
very low-churn sub-project. The consequence of this is that project
maintainers will need to be diligent about testing/accepting any pull
requests touching that project. This is similar to the current situation
with app-template (no CI tests.)
@technomancy
Copy link
Owner

This is now supported in 2.3.4.

@daveliepmann
Copy link
Contributor

I encountered this issue on lein 2.7.1 and resolved it with @kasterma's workaround of removing SNAPSHOT from my template's project.clj. The template has never been pushed to Clojars. Is this expected behavior?

$ lein -version
Leiningen 2.7.1 on Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM

@technomancy
Copy link
Owner

technomancy commented Jun 16, 2017 via email

@daveliepmann
Copy link
Contributor

lein install in the template directory, then lein new <template name> <project name> in another directory.

@technomancy
Copy link
Owner

That explains it; you need a --snapshot argument when running lein new ....

@cloojure
Copy link

I just ran into the same problem. Seems to work if I remove -SHAPSHOT suffix from the version prior to "lein install".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants