boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 181 forks source link

Could not locate class #756

Closed 0x4d6165 closed 4 years ago

0x4d6165 commented 4 years ago

Describe the bug Despite using (:gen-class) in the main class file, I keep getting this error on boot build (which uses aot to create an uberjar)

Compiling 1/1 redblackrose.core...
                                       java.lang.Thread.run                  Thread.java:  748
         java.util.concurrent.ThreadPoolExecutor$Worker.run      ThreadPoolExecutor.java:  624
          java.util.concurrent.ThreadPoolExecutor.runWorker      ThreadPoolExecutor.java: 1149
                        java.util.concurrent.FutureTask.run              FutureTask.java:  266
                                                        ...                                   
                        clojure.core/binding-conveyor-fn/fn                     core.clj: 2030
                                          boot.core/boot/fn                     core.clj: 1031
                                        boot.core/run-tasks                     core.clj: 1022
                       boot.task.built-in/eval2946/fn/fn/fn                 built_in.clj:  804
                                          boot.pod/eval-in*                      pod.clj:  471
                                                        ...                                   
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  ClojureRuntimeShimImpl.java:   97
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke  ClojureRuntimeShimImpl.java:  104
                                                        ...                                   
                                          boot.pod/eval-in*                      pod.clj:  468
                                          clojure.core/eval                     core.clj: 3214
                                                        ...                                   
                                         pod$eval158.invoke                NO_SOURCE_FILE     
                                   pod$eval158.invokeStatic                NO_SOURCE_FILE     
                                       clojure.core/compile                     core.clj: 6136
                                    clojure.core/compile/fn                     core.clj: 6136
                                      clojure.core/load-one                     core.clj: 5908
                                                        ...                                   
                                          clojure.core/load                     core.clj: 6109
                                          clojure.core/load                     core.clj: 6125
                                       clojure.core/load/fn                     core.clj: 6126
                                                        ...                                   
java.io.FileNotFoundException: Could not locate redblackrose/core__init.class, redblackrose/core.clj or redblackrose/core.cljc on classpath.
   clojure.lang.ExceptionInfo: Could not locate redblackrose/core__init.class, redblackrose/core.clj or redblackrose/core.cljc on classpath.
    line: 39

To Reproduce

(set-env!
 :source-paths    #{"src/clj" "src/cljc"}
 :resource-paths  #{"resources"}
 :dependencies '[[org.clojure/clojure "1.10.1"]])

(def version "0.1.0-SNAPSHOT")
(task-options! pom {:project 'redblackrose
                    :version (str version "-standalone")
                    :description "FIXME: write description"
                    :license {"Eclipse Public License" "http://www.eclipse.org/legal/epl-v10.html"}}
               jar {:main 'redblackrose.core}
               aot {:all true})

;; == Cider Support =======================================

(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
       concat '[[cider/cider-nrepl "LATEST"]])

(swap! boot.repl/*default-middleware*
       conj 'cider.nrepl/cider-middleware)

;; -- My Tasks --------------------------------------------

(deftask build
  "Build an uberjar of the project."
  []
  (comp (aot) (pom) (uber) (jar) (target)))
;src/clj/core.clj
(ns redblackrose.core
  (:gen-class))

(defn -main [& args]
  (println "I don't do much yet."))

Expected behavior I'd like the jar to compile.

Desktop (please complete the following information):

nha commented 4 years ago

Shouldn't the file be src/clj/redblackrose /core.clj @gigavinyl ?

0x4d6165 commented 4 years ago

Aww shoot. Thanks! That did it.