I have a deps.edn project. When I start a repl in intellij/cursive the repl starts on a random port. Is there a way for me to specify which port it is?
why do you want this?
if you want to connect an external tool to cursive repl, use .nrepl-port file, available in the REPL pwd.
I have a monorepo and I'm running lots of applications at once and they overwrite this file. Sometimes I want to connect to one of these application repls, but the port is no longer discoverable except in the case of whichever application started most recently. If I could make it so every application's repl started on a port dedicated to that application I wouldn't have this problem.
You should be able to require the nrepl.server namespace and then call
(nrepl.server/start-server :bind "0.0.0.0" :port nrepl-port)
in each of your apps to set the port to whatever you want.Right that would work if I was running the application stand alone. But I'm asking about when I launch it is a Clojure Repl run configuration inside cursive.
https://nrepl.org/nrepl/usage/server.html#server-configuration i think you can set a config file at the nrepl level, not necessarily at the cursive level
Unfortunately this doesn't help. It looks like cursive is explicitly setting a port number.