Welcome! Please see the About page for a little more info on how this works.

0 votes
in Tools by
edited by

I have a fresh install of clojure 1.10.1.483 on a RHEL7 docker image, with the repos in /usr/local/lib/clojure/deps.edn (the installation level config) modified to point to our corporate artifactory repository.

However, despite the -Sverbose option saying the file is in the config_paths, these repos are not picked up if running anywhere outside the directory itself.

Doing something like clojure -e “(clojure-version)”

  • works from within the installation dir as the deps.edn is picked up as the ‘project’ config. This indicates there is nothing wrong with the config itself.
  • fails in any other dir, saying it cannot connect to the default repos (repo1.maven.org etc), which do not exist in any config file being checked.

User level config is default (all commented) so should not impact, but -Srepro makes no difference.

I can only conclude that the installation level config is not picked up correctly.

Does anyone have any pointers here?

1 Answer

+1 vote
by
selected by
 
Best answer

I believe that tools.deps.alpha now "bakes in" the system config as part of its distribution and the actual deps.edn file in the "system" location is provided for backward compatibility only and is not actually used now.

In any case, you should definitely not modify the "system" version, only the per-user or per-project version.

by
I'm also pretty sure that config_paths and :config-files are only provided for legacy reasons now and don't actually reflect how the dependencies are really processed -- for example, they include a local deps.edn even when no such file actually exists.
by
Thanks. That is interesting and I guess the docs are not really in sync. It is slightly unfortunate because this removes the ability in a corporate environment (without external internet/maven access) to adjust the installation so it ‘just works’ for everyone.

Other potential improvements along these same lines are:
- allowing a custom download URL (eg via env variable) or specifying an offline tarball to install from
- providing a local install option that does not require root. Again this could work through env by looking for a CLJ_HOME or similar.
by
What we do at work is use the CLJ_CONFIG environment variable to point to a directory within our monorepo that has a deps.edn that essentially replaces the user-level one. That's how we provide a consistent customized environment for all developers.
...