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

load-project fails when using :env in the authentication credentials for a repository #11

Open
gerrit-hntschl opened this issue Sep 4, 2015 · 2 comments

Comments

@gerrit-hntschl
Copy link

Invoking load-project fails for me with this exception:

java.lang.IllegalArgumentException: No matching ctor found for class org.sonatype.aether.repository.Authentication
               Reflector.java:183 clojure.lang.Reflector.invokeConstructor
                   aether.clj:165 cemerick.pomegranate.aether/set-authentication
                   aether.clj:185 cemerick.pomegranate.aether/make-repository
                   aether.clj:712 cemerick.pomegranate.aether/resolve-dependencies*[fn]
                    core.clj:2559 clojure.core/map[fn]
                  LazySeq.java:40 clojure.lang.LazySeq.sval
                  LazySeq.java:49 clojure.lang.LazySeq.seq
                     Cons.java:39 clojure.lang.Cons.next
         PersistentVector.java:51 clojure.lang.PersistentVector.create
   LazilyPersistentVector.java:31 clojure.lang.LazilyPersistentVector.create
                     core.clj:354 clojure.core/vec
                   aether.clj:712 cemerick.pomegranate.aether/resolve-dependencies*
                  RestFn.java:137 clojure.lang.RestFn.applyTo
                     core.clj:624 clojure.core/apply
                   aether.clj:729 cemerick.pomegranate.aether/resolve-dependencies
                  RestFn.java:512 clojure.lang.RestFn.invoke
                 (Unknown Source) clojure.core/eval1726
               Compiler.java:6703 clojure.lang.Compiler.eval
               Compiler.java:6693 clojure.lang.Compiler.eval
               Compiler.java:6666 clojure.lang.Compiler.eval
                    core.clj:2927 clojure.core/eval
                 (Unknown Source) clojure.core/eval1722
               Compiler.java:6703 clojure.lang.Compiler.eval
               Compiler.java:6666 clojure.lang.Compiler.eval
                 (Unknown Source) sun.reflect.NativeMethodAccessorImpl.invoke0
 NativeMethodAccessorImpl.java:62 sun.reflect.NativeMethodAccessorImpl.invoke
DelegatingMethodAccessorImpl.java:43 sun.reflect.DelegatingMethodAccessorImpl.invoke
                  Method.java:497 java.lang.reflect.Method.invoke
                      core.clj:54 classlojure.core/invoke-in*
                  RestFn.java:494 clojure.lang.RestFn.invoke
                      core.clj:72 classlojure.core/eval-in*[fn]
                      core.clj:74 classlojure.core/eval-in*
                  RestFn.java:425 clojure.lang.RestFn.invoke
                     AFn.java:156 clojure.lang.AFn.applyToHelper
                  RestFn.java:132 clojure.lang.RestFn.applyTo
                     core.clj:634 clojure.core/apply
                      core.clj:93 classlojure.core/eval-in
                  RestFn.java:425 clojure.lang.RestFn.invoke
                     still.clj:93 alembic.still/resolve-dependencies
                    still.clj:178 alembic.still/add-dependencies
                    still.clj:297 alembic.still/load-project*
                    still.clj:319 alembic.still/load-project
                  RestFn.java:439 clojure.lang.RestFn.invoke
                    still.clj:330 alembic.still/load-project
                    still.clj:332 alembic.still/load-project

Inside my project.clj I have this:

:repositories {"my.datomic.com" {:url "https://my.datomic.com/repo"
                                   :username [:env/datomic_user]
                                   :password [:env/datomic_password]}}

From my quick debug session it seems that the culprit is alembic.still/load-project*

the username and password is correctly substituted inside the classlojure invocation:

(classlojure/eval-in
         (:alembic-classloader @still)
         `(do
            (require '[leiningen.core.project :as ~'project])
            (let [project# (leiningen.core.project/read ~project-file)]
              [(:dependencies project#)
               (:repositories project#)])))

But in the subsequent call to (add-dependencies still dependencies (into {} repositories) options) the username and password are still the vector containing the keyword.

Cheers,
Gerrit

@gerrit-hntschl gerrit-hntschl changed the title load-project fails when using :env in the authentication credentials for a repository load-project fails when using :env in the authentication credentials for a repository Sep 4, 2015
@jstaffans
Copy link

I also ran into this issue with a repository defined like this in project.clj:

:repositories  [["releases"  {:id  "releases"
                                :url "<nexus url>"
                                :username :env/nexus_username
                                :password :env/nexus_password
                                :sign-releases false}]]

@alexandergunnarson
Copy link

alexandergunnarson commented Dec 20, 2016

I also had this problem (possibly due to an unrelated issue). I removed lein-essthree from the dependencies/plugins and that did the trick for me.

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

3 participants