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

tools.nrepl version added is very old #193

Open
kumarshantanu opened this issue Sep 29, 2017 · 7 comments
Open

tools.nrepl version added is very old #193

kumarshantanu opened this issue Sep 29, 2017 · 7 comments

Comments

@kumarshantanu
Copy link

The latest Leiningen version 2.7.1 adds [org.clojure/tools.nrepl "0.2.12"] whereas lein-ring adds [org.clojure/tools.nrepl "0.2.3"] to the project dependencies, which causes conflict when running lein ring server-headless with nREPL config enabled and :pedantic? :abort entry in project.clj.

Please either allow a way to specify the tools.nrepl version to be used with lein-ring, or use the latest version synced with latest Leiningen.

@MichaelBlume
Copy link
Collaborator

I will probably upgrade this, but note that any dependency added by lein-ring can be superseded by depending on the thing explicitly

@kumarshantanu
Copy link
Author

I will probably upgrade this, but note that any dependency added by lein-ring can be superseded by depending on the thing explicitly

I tried adding an explicit tools.nrepl dependency (in :dev profile) but kept getting the same error due to :pedantic? :abort. Did you mean the same mechanism?

@MichaelBlume
Copy link
Collaborator

MichaelBlume commented Sep 30, 2017 via email

nxvipin pushed a commit to nxvipin/lein-ring that referenced this issue Jan 18, 2019
nxvipin pushed a commit to nxvipin/lein-ring that referenced this issue Jan 18, 2019
nxvipin pushed a commit to nxvipin/lein-ring that referenced this issue Jan 18, 2019
nxvipin pushed a commit to nxvipin/lein-ring that referenced this issue Jan 18, 2019
@rborer
Copy link
Contributor

rborer commented May 13, 2019

Jumping on the discussion since I have a similar issue with ring. I am wondering if lein ring server/server-headless should not remove any :pedantic config.

Within my project I use pedantic to ensure that dependencies converge at build time. Since running lein server is for local developments only it should be safe to turn off.

What do you think?

@dpsutton
Copy link

I'm depending on [nrepl/nrepl "0.6.0"] but cannot override the nrepl dependency that lein-ring uses.

@Outrovurt
Copy link

Outrovurt commented Jul 27, 2020

I'm depending on [nrepl/nrepl "0.6.0"] but cannot override the nrepl dependency that lein-ring uses.

No, you won't be able to using this approach. If you have a look at the code, specifically:

https://github.com/weavejester/lein-ring/blob/master/src/leiningen/ring/server.clj

you will see that lein-ring explicitly references the older org.clojure/tools.nrepl, and there is no way to override this without updating the code. You could use the forked version referenced above, i.e.:

https://github.com/nxvipin/lein-ring

or wait for an update.

@Outrovurt
Copy link

Outrovurt commented Jul 27, 2020

... or, you can simply run a normal repl, e.g. via lein repl, start a jetty server manually, store its instance in an atom, and then you will have the version of nREPL which ships with leiningen (or the one you have specified explicitly in your dependencies.)

You can create the following as dev/user.clj:

(ns user
  (:require
   [ring.adapter.jetty :refer (run-jetty)]
   [your.server.app :refer (app-handler)]
   ))

(def server (atom nil))
(def server-opts
  {:port  3000
   :join? false})

(defn ring-start
  []
  
  (reset! server
          (run-jetty app-handler server-opts)))

(defn ring-stop
  []
  (.stop @server))

And don't forget to add "dev" to your :source-paths vector in your :dev profile so that the above file will be included in your source path. (As an added bonus, you can even add a ring-reset function, which may come in very useful when you make code changes.)

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

No branches or pull requests

5 participants