ClojureNRepl

Starts an nREPL server. Requires an external nREPL client for interaction.

Command-Line Arguments

All are optional. See Properties below for details.

  • --bind=<address>

  • --port=<port>

  • --ackPort=<port>

  • --handler=<symbol>

  • --middleware=<symbol> [--middleware=<symbol2> …​]

Example
$ ./gradlew clojureRepl --port=7555

Properties

Property Type Description

classpath

ConfigurableFileCollection

Classpath of the nREPL server JVM

bind

Property<String>

Address the server will listen on. (Defaults to 127.0.0.1)

port

Property<Integer>

Port the server will listen on. (Defaults to random open port.)

ackPort

Property<Integer>

Acknowledge the port of this server to another nREPL server running on ackPort.

handler

Property<String>

The nREPL message handler to use for each incoming connection; defaults to the result of (nrepl.server/default-handler).

middleware

ListProperty<String>

A sequence of vars, representing middleware you wish to mix in to the nREPL handler.

javaLauncher

Property<JavaLauncher>

Overrides the Java executable to use for the task’s JVM

forkOptions

ForkOptions

Configure JVM settings

Example

To configure a REPL task:

build.gradle
tasks.named('clojureRepl')
  classpath.from(configurations.other)
  bind = '127.0.0.1'
  port = 7555
  ackPort = 8666
  handler = 'cider/cider-nrepl-handler'
  middleware = ['cider.nrepl/cider-middleware', 'cider.piggieback/wrap-cljs-repl']
  forkOptions {
    jvmArgs = ['-Xmx4g']
  }
}
build.gradle.kts
val clojureRepl by tasks.existing {
  classpath.from(configurations.other)
  bind = "127.0.0.1"
  port = 7555
  ackPort = 8666
  handler = "cider/cider-nrepl-handler"
  middleware = listOf("cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl")
  forkOptions {
    jvmArgs = listOf("-Xmx4g")
  }
}