I am trying to enhance the dependency management of a Clojure/ClojureScript project built with lein
. Hence, I am using a library called lein-tools-deps. I added it to my project.clj
file:
(defproject my-project
:description "description"
:url "https://github.com/pdelfino/whatever-does-the-repos-name-matter-at-all-here?"
:plugins [[lein-tools-deps "0.4.5"]]
...omitted...)
The main purpose of this addition is getting private maven packages directly from GitHub Packages instead of having them locally and doing lein install
for every new release.
Also, I created a deps.edn
file. It works for the public packages
. But, I am having trouble with the private
ones. I am trying to follow the documentation. Hence, I tried:
{:paths ["src" "dev"]
:deps { ;; lein dependencies
org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339"}
org.clojure/tools.nrepl {:mvn/version "RELEASE"}
;; private
com.my-organization/private-repo1 {:mvn/version "1.2.15"
:deps/manifest :pom
:git/url "https://github.com/my-org/private-repo"}
com.my-organization/private-repo2 {:sha "230483c88ff1cef5248878182ec98cff07b212a9"
;:git/tag "v1.2.15"
:git/url "git@github.com:my-org/private-repo.git"}}
:mvn/repos {"github" {:url "https://maven.pkg.github.com/my_organization/*"}
;; "github-2" {:url "https://github.com/my_organization/*"}}}
The private packages are being hosted on GitHub Packages as private packages:
There is a XML holding meta-data:
<dependency>
<groupId>com.my-organization</groupId>
<artifactId>private-repo1</artifactId>
<version>1.2.15</version>
</dependency>
In addition, I have a .m2/settings.xml
file:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<offline/>
<pluginGroups/>
<servers>
<!-- <server> -->
<!-- <id>github-2</id> -->
<!-- <username>pdelfino</username> -->
<!-- <password>my-password-which-will-not-be-shared</password> -->
<!-- <configuration> -->
<!-- <httpHeaders> -->
<!-- <property> -->
<!-- <name>Authorization</name> -->
<!-- <!-\- Base64-encoded "<username>:<password>" -\-> -->
<!-- <value>Basic password-which-will-not-be-shared==</value> -->
<!-- </property> -->
<!-- </httpHeaders> -->
<!-- </configuration> -->
<!-- </server> -->
<server>
<id>github</id>
<username>pdelfino</username>
<password>password-which-will-not-be-shared</password>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<!-- Base64-encoded "<username>:<password>" -->
<value>Basic converted-password-which-will-not-be-shared==</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
Unfortunately, when I execute lein install
on this repository, my
expectation was that the packages would be successfully installed.
But, terminal returns an error:
➜ lein install
If there are a lot of uncached dependencies this might take a while ...
Cloning: git@github.com:my-organization/private-repo1.git
org.eclipse.jgit.api.errors.TransportException: git@github.com:my-organization/private-repo1.git: Auth fail
How do I fix this?