nRepl missing java classes on classpath

63 views
Skip to first unread message

Matt Bossenbroek

unread,
Jan 19, 2015, 12:46:56 AM1/19/15
to cloju...@googlegroups.com
I'm trying to get the nRepl plugin of clojuresque working in this project: https://github.com/Netflix/PigPen

I added the nrepl dependency, added the port config (you get an error without it), and it starts the repl. I can connect to it, but if I require a namespace that loads java classes within the project, they aren't on the classpath.

Here's the build file in the branch I'm working on: https://github.com/Netflix/PigPen/blob/fix-nrepl/build.gradle


Any ideas what I'm missing? Let me know if you need more info.

Thanks,
Matt

Matt Bossenbroek

unread,
Jan 19, 2015, 1:35:06 PM1/19/15
to cloju...@googlegroups.com
I found a different way to start an nRepl server:

    ////////////////////////////////////////////////////////////////////////////////

    // Define a task that runs an nrepl server. The port is given with the nreplPort

    // property:

    //    gradlew nrepl -PnreplPort=9999

    // or put the property in ~/.gradle/gradle.properties

    configurations { nrepl }

    dependencies {

      nrepl 'org.clojure:tools.nrepl:0.2.7'

      nrepl 'org.clojure:clojure:1.6.0'

    }

    task nrepl(type: JavaExec) {

        classpath project.sourceSets.main.clojure.srcDirs,

                  project.sourceSets.test.clojure.srcDirs,

                  sourceSets.test.runtimeClasspath,

                  sourceSets.main.runtimeClasspath,

                  configurations.nrepl


        main = "clojure.main"

        args '--eval', "(ns gradle-nrepl (:require [clojure.tools.nrepl.server :refer (start-server stop-server)]))",

             '--eval', "(println \"Starting nrepl server on port $nreplPort\")",

             '--eval', "(def server (start-server :port $nreplPort))"

    }


This seems to work, so nevermind :)

-Matt

Meikel Brandmeyer

unread,
Jan 19, 2015, 3:01:13 PM1/19/15
to cloju...@googlegroups.com
Hi,

this is rather strange. I set up the repl task to include the output of
all source sets. So any java source should be compiled and be available
on the classpath. I have to understand what's going on there.

Meikel

Reply all
Reply to author
Forward
0 new messages