Fork me on GitHub

Hi! I'm trying to invoke tools.deps directly from clojure (more specifically but I get a

Cannot access s3p://... using the registered transporter factories: HttpTransporterFactory, S3TransporterFactory, FileTransporterFactory
error. If I run a clj -Sdeps with the same content it works fine. Is there any library that I should include in the classpath to make s3 repos work? Or any environment variable or system property that I should set? I'm using org.clojure/tools.deps.alpha {:mvn/version "0.8.677"}.

Alex Miller (Clojure team)13:04:31

@rfhayashi did you try s3:// ? that's the only documented protocol for s3 access (s3p did work in some older versions but has never been supported)

Alex Miller (Clojure team)13:04:02

you should not have to do anything special to get s3 to work


@alexmiller it does work. thanks!


is there any support for modifying the bootclasspath, like: does for leiningen? It would be nice to use some special case of :boot-deps so that I don’t have hack it together with downloading jar files locally from maven and using :jvm-opts directly


this seems to be in the focus area of tools-deps of invoking java with the correct dependencies ready

Alex Miller (Clojure team)14:04:30

you should not modify the bootclasspath in my opinion, so I'm not going to make that any easier


there are legitimate use-cases, like enabling alpn for jdk8 for http2: I agree that it should be avoided when possible, but now I need to hack around deps.edn because of the lack of support

Alex Miller (Clojure team)14:04:15

you can make an alias that produces the boot classpath you need, then use clj -Spath to generate the classpath from it, so there is no need for manual jar downloading

Alex Miller (Clojure team)14:04:58

and then put that path in your :jvm-opts


clj -Spath would produce an absolute path to my main maven repo, which is hosted in my home directory


meaning the resulting :jvm-opts needs to be scripted on each machine

Alex Miller (Clojure team)14:04:51

an alternative would be to set :mvn/local-repo to fetch it into a subdirectory of the project, then use relative paths in the jvm-opts


wouldn’t that apply to all maven deps? I haven’t used that one yet


I don’t want to download maven again 😂

Alex Miller (Clojure team)14:04:11

you would just use this for what you need in the bootclasspath


thanks for the help


I'm using clojure cli / deps.edn. Is there a way to define env vars following the 12 factor app? Looking into but it seems like it does not support deps.edn (for instance, if your using lein. you can have .lein-env)


@jaime.sangcap (System/getenv "varname") is all you need to get an environment variable's value so I'm not sure what you're asking in the context of CLI/`deps.edn`?


Perhaps "Can you have environment variables in your deps.edn?" No. It's a pure EDN file, not executable code, and has no substitutions made.


I'm wondering if there is library that can load env var from file. And you can configure where the file is in the deps.edn. Right now I'm only using intellij to set env vars. What I'm thinking is there should be a example file (checkin to version control) that has all the required env var Then locally, the library will check the example file against your env file for missing env var


This might be at least partially what you're looking for:


cool! Yes I think can use this. Thanks 🙂

👍 4

Before loading them and throw error is you missed to set something


Sorry, I have no idea what you mean by any of that.


Thanks! I think I'm mixing different things


Environment variables are set at the O/S level before a process is started -- I would imagine IntelliJ is setting the environment variables before starting the REPL or run process.


You can't set environment variables from inside a process. You can set JVM properties tho'...


BTW environ is just a library. It can be used from any process run by CLI/`deps.edn`.


It just happens to have existing plugins for lein and boot that call it in particular ways.


(but I would caution you against storing anything in deps.edn that isn't part of the official syntax -- deps.edn is not intended to be a "general configuration file -- which project.clj and build.boot tend to be)