Fork me on GitHub

When I have a tools-deps alias which has -m as main-opts the cursive nrepl seems to ignore those, when started with that alias. Am I doing something wrong or is this intended behaviour?


how does your run configuration look like exactly? maybe u can just paste the corresponding XML here from your .idea/runConfiguration or .run folder



<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="CLJ REPL" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false">
    <module name="meetly" />
    <setting name="replType" value="NREPL" />
    <setting name="execution" value="DEPS" />
    <setting name="jvmArgs" value="-Dghostwheel.enabled=true" />
    <setting name="parameters" value="" />
    <setting name="workingDir" value="$PROJECT_DIR$" />
    <setting name="profiles" value="" />
    <setting name="aliases" value="run-server" />
    <setting name="fixLineNumbers" value="false" />
    <method v="2" />
The run-server alias has a main-opt -m project.server. Its main is never executed. I even put non-existing function-calls in to see if it breaks. But it does not run at all.


When i do clj -A:run-server it works just fine. But of course I would like to have it inside of my nrepl


okay, so this is a Local nREPL config. IntelliJ have to tell your app to start an nREPL server, so the IntelliJ process can connect and talk to it.


when u start it from the command line, there is no need for a server, because your application process is accepting input from the stdin directly


if u click on the line which appears at the top of your Cursive REPL window, it should expand to a very long command line. at the end of that command-line, there is a -i <some/randomly/named.clj>. that is the program which executes first and enters an nREPL server loop. because of that, no other code has the chance to interpret the -m option from the command-line.


(or something like that; can't remember it precisely)


Thanks, so there is no option to start the -main function inside the newly created nrepl, except of doint it by hand then?


im not sure i understand that question, but at the same time im not sure i can explain it more precisely either. how i understood this was by reading the source code of clojure.main/-main which is referenced from this java entry point:


nothing really beats reading the source code, when it comes to understanding how things work 🙂