luminus-framework / luminus-framework/luminus-template

Consider not requiring core ns in env/dev/user.clj

Open
#297 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
648
Forks
143
PR merge metrics
No merged PRs in 30d

Description

I was getting byzantine errors when trying to (:import) a java class we had in our :java-source-paths in the project.clj, saying it wouldn't import. It turns out, that by having a reference to the `core` NS causes some form of dependency chain that makes the java file fail to be compiled and imported.

See [here](https://www.reddit.com/r/Clojure/comments/5f2ctk/cant_compile_java_sources_with_lein_javac/), [here](https://github.com/technomancy/leiningen/issues/1477) and [here](https://github.com/technomancy/leiningen/issues/1245) for a sample of such errors.

The solution for us was to remove the reference to the core ns, and remove the REPL server definition there (so we don't need to except it in the `(start)` and `(stop)` functions). We added a new `(init)` fn which did require that NS, making the start and stop work again.

Possibly there are cleaner ways of solving it, but the current template is broken as soon as you want to import local java files.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with env/dev/user.clj and the project.clj java-source-paths configuration. Compare the current core namespace and REPL server references with the reported init/start/stop workaround, then verify that local Java sources compile and import while the development REPL still starts and stops correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.