This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-27
Channels
- # announcements (47)
- # babashka (36)
- # beginners (7)
- # biff (34)
- # calva (9)
- # cider (5)
- # clj-http (13)
- # clj-kondo (24)
- # cljs-dev (9)
- # clojure (146)
- # clojure-austin (1)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (2)
- # clojurescript (4)
- # clr (1)
- # core-async (9)
- # cursive (11)
- # datomic (6)
- # emacs (17)
- # events (3)
- # fulcro (45)
- # graphql (7)
- # helix (1)
- # hyperfiddle (28)
- # java (1)
- # london-clojurians (1)
- # lsp (75)
- # malli (1)
- # membrane (35)
- # reitit (6)
- # releases (1)
- # shadow-cljs (48)
- # tools-build (5)
- # tools-deps (27)
I'm having a bit of trouble using a library with a java compilation step with :deps/prep-lib
.
I have a project A
with a :local/root
dependency on a project B
that has a :deps/prep-lib
entry that compiles java. I can do a clj -X:deps prep
from the project directory of A
, and that works - I get a message about prepping B
, and the compilation results are in B/target/classes
. The problem is that the generated classpath of A
doesn't seem to include anything like the target/classes
directory of B, so when A
launches, we get an error that the java class wasn't found (because it's not on the classpath).
When we prep a lib, I assume it's correct for the lib's prep results to be in its own directory?
prep/libs doesn't magically add directories to the classpath, they should be declared in deps.edn
I really appreciate your help but I begin to feel a bit guilty that you're the one who answers all of my questions. ๐
I feel like this sort of means that I need to have target/classes in the classpath just for this case, even if it isn't required (I don't think) for the normal case where I've deployed a jar.
No problem at all, happy to help. If you want to do anything in return, feel free to sponsor. I'd rather have people do this out of gratitude rather than guilt though :)
You can see the docs here: https://clojure.org/reference/deps_and_cli#prep
Ok yes, adding "target/classes" as a resource path in the library (`B`) resolves the problem, as you suggested it would.
hello, has pulling from http maven repos been intentionally dropped in some clojure 1.11 verision? I am getting
clojure -Spom -Srepro
...
Error building classpath. Invalid repo url (http not supported):
on clj version 1.11.1.1224
, the command succeeds on 1.11.1.1200
. if intentional are there are any workounds on the maven side to get around the http check, thanks in advance
% java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
Yes, this is no longer allowed in the Maven ecosystem to protect against man-in-the-middle attacks so we've followed their lead, see https://maven.apache.org/docs/3.8.1/release-notes.html#cve-2021-26291
If there is a need here (seems like there might be), please file a question on http://ask.clojure.org and I will consider a way to allow it with some config
in the meantime, you'll want to fall back to the older release - you can find instructions on how to do that with brew at https://github.com/clojure/homebrew-tools#version-archive-tool-releases (with Linux you just install the older version)
it would be helpful to know if you are using Maven mirroring in your settings.xml
Upgrading Nexus server to use HTTPS is the recommended approach I assume Maven gives (or use a mirror service that supports HTTPS) I vaguely remember we updated Nexus back in 2018 when Maven introduce this change. Or maybe we migrated to artefactory Leiningen dropped support for http repos around the same time, with release 2.9.x
yes, that is the recommendation from Nexus
but I also don't want to make this unusable in the meantime so I gate the check with a flag or something
thanks for looking, I filed the question here: https://ask.clojure.org/index.php/12698/deps-all-pulling-from-http-maven-repos thanks
I don't know if you saw in other threads, but I released a new version of the Clojure CLI today that allows you to reenable it by setting the environment variable CLOJURE_CLI_ALLOW_HTTP_REPO
1.11.1.1237
When will -A
stop running :main-opts
? ๐
โLaterโ