Skip to content

Instantly share code, notes, and snippets.

@piotr-yuxuan
Created August 20, 2020 21:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotr-yuxuan/612f3f6639b28d64cf4ecc42a1fdd212 to your computer and use it in GitHub Desktop.
Save piotr-yuxuan/612f3f6639b28d64cf4ecc42a1fdd212 to your computer and use it in GitHub Desktop.
Load a standalone Clojure library from a GitHub repository

Download from private GitHub Packages

Add this server in ~/.m2/settings.xml:

<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
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>org.github.piotr-yuxuan</id>
      <username>${env.GH_PACKAGES_USR}</username>
      <password>${env.GH_PACKAGES_PSW}</password>
    </server>
  </servers>
</settings>

Install Clojure CLI tools (guide).

clj -Sdeps '{:deps {org.piotr-yuxuan/secret-weapon {:mvn/version "0.0.0"}}, :mvn/repos, {"org.github.piotr-yuxuan" {:url "https://maven.pkg.github.com/piotr-yuxuan/secret-weapon"}}}' \
    -m org.piotr-yuxuan.secret-weapon.main -- \
    --help

Other downloads from GitHub Packages

See https://clojure.org/reference/deps_and_cli#_maven_authenticated_repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment