Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for settings from user profiles.clj #21

Open
sashton opened this issue Apr 30, 2015 · 0 comments
Open

Add support for settings from user profiles.clj #21

sashton opened this issue Apr 30, 2015 · 0 comments

Comments

@sashton
Copy link
Contributor

sashton commented Apr 30, 2015

It appears that the user profile -- ~/.lein/profiles.clj -- is not used for setting repositories/local-repo/mirrors when executing scripts. If I have a custom local repo set in profiles, and I lein install a custom library, I am unable to refer to it in a script, since it can't be found in the default repositories.

Also, at work I have to specify mirrors for repositories. I've already done that in ~/.lein/profiles.clj, and it would be un-DRY if I had to specify the correct repos in every script, rather than a single profiles.clj file.

If I have a non-default local-repo setting in my profiles.clj, and I somehow configure my script to refer to it (not sure if that's even possible), I can't share my script with a team member who has a different local-repo location.

Example:

~/.lein/profiles.clj
{:user {:local-repo "/custom/location/.m2/"
        :plugins [[lein-exec "0.3.4"]]
        :mirrors {"central" {:name "central"
                             :url "http://my.corp/central"}}
Then running:
$ cd ~
$ lein new app cool-library
$ lein install
Installed jar and pom into /custom/location/.m2/.
~/some-script.clj
(use '[leiningen.exec :only (deps)])
(deps '[[cool-library "0.1.0-SNAPSHOT"]])
Trying to use the dependency
$ cd ~
$ lein exec example.clj
clojure.lang.Compiler$CompilerException: org.sonatype.aether.resolution.DependencyResolutionException: Could not find artifact cool-library:cool-library:jar:0.1.0-SNAPSHOT in clojars (http://clojars.org/repo), compiling:(~/example.clj:3:37)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant