cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Problems downloading artifacts from private Maven repos

Open msolli opened this issue 7 months ago • 0 comments

We have a few packages published to Github's private maven repo for our organization. These packages are referenced from deps.edn such:

{:paths   ["src" "resources"]
 :deps    {my-org/my-package {:mvn/version "1.0.0"}}
 :mvn/repos
 {"github" {:url "https://maven.pkg.github.com/my-org/*"}}}

Then, in ~/.m2/settings.xml:

<settings>
    <servers>
        <server>
            <id>github</id>
            <username>${env.REPO_USERNAME}</username>
            <password>${env.REPO_PASSWORD}</password>
        </server>
    </servers>
</settings>

On the command-line these env variables are managed by direnv such that they are loaded from .envrc in the root of the project when cd-ing into the directory. My guess is that Cursive can't (and won't) know about this mechanism.

So I get errors like this when refreshing Clojure Deps:

Errors during project resolve

/Users/martin/c/my-org/my-project/deps.edn:
Failed to read artifact descriptor for my-org:my-package:jar:1.0.0

From the command-line the dependency is downloaded just fine:

$ clj -X:deps prep :aliases '[:dev :test]'
Downloading: my-org/my-package/1.0.0/my-package-1.0.0.pom from github
Downloading: my-org/my-package/1.0.0/my-package-1.0.0.jar from github

And after this manual download, the deps refresh happens without error.

There are settings for proving environment variables to deps.clj, but it didn't seem to have an effect:

Image

msolli avatar May 02 '25 08:05 msolli