在 Leiningen 项目的 Google Maven 仓库中找不到 Firebase jar

Not finding Firebase jars in Google Maven repo in Leiningen project

我有一个使用 Leiningen 的 Clojure 项目需要访问 Firebase Admin SDK。所以我正在尝试使用 Google 的 Maven 中的 Java 版本。当我 运行 lein repl 时最终发生的事情是它开始下载该特定 jar 的所有要求,但随后因以下错误而崩溃:

Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in central (https://repo1.maven.org/maven2/)
Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in clojars (https://repo.clojars.org/)
Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in google (https://maven.google.com/)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Exception in thread "Thread-1" clojure.lang.ExceptionInfo: Could not resolve dependencies {:suppress-msg true, :exit-code 1}
    at clojure.core$ex_info.invokeStatic(core.clj:4617)
    at clojure.core$ex_info.invoke(core.clj:4617)
    at leiningen.core.classpath$get_dependencies_STAR_.invokeStatic(classpath.clj:311)
    at leiningen.core.classpath$get_dependencies_STAR_.invoke(classpath.clj:265)
    at clojure.lang.AFn.applyToHelper(AFn.java:165)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.core$apply.invokeStatic(core.clj:646)
    at clojure.core$apply.invoke(core.clj:641)
    at clojure.core$memoize$fn__14312.doInvoke(core.clj:6109)
    at clojure.lang.RestFn.invoke(RestFn.java:457)
    at leiningen.core.classpath$get_dependencies$fn__9133.invoke(classpath.clj:332)
    at leiningen.core.classpath$get_dependencies.invokeStatic(classpath.clj:330)
    at leiningen.core.classpath$get_dependencies.doInvoke(classpath.clj:324)
    at clojure.lang.RestFn.invoke(RestFn.java:445)
    at clojure.lang.AFn.applyToHelper(AFn.java:160)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invokeStatic(core.clj:652)
    at clojure.core$apply.invoke(core.clj:641)
    at leiningen.core.classpath$resolve_managed_dependencies.invokeStatic(classpath.clj:441)
    at leiningen.core.classpath$resolve_managed_dependencies.doInvoke(classpath.clj:428)
    at clojure.lang.RestFn.invoke(RestFn.java:445)
    at leiningen.core.eval$prep.invokeStatic(eval.clj:85)
    at leiningen.core.eval$prep.invoke(eval.clj:73)
    at leiningen.core.eval$eval_in_project.invokeStatic(eval.clj:362)
    at leiningen.core.eval$eval_in_project.invoke(eval.clj:356)
    at leiningen.repl$server$fn__12516.invoke(repl.clj:244)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.core$apply.invokeStatic(core.clj:646)
    at clojure.core$apply.invoke(core.clj:641)
    at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1890)
    at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1881)
    at clojure.lang.RestFn.invoke(RestFn.java:425)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.RestFn.applyTo(RestFn.java:132)
    at clojure.core$apply.invokeStatic(core.clj:650)
    at clojure.core$apply.invoke(core.clj:641)
    at clojure.core$bound_fn_STAR_$fn__13275.doInvoke(core.clj:1912)
    at clojure.lang.RestFn.invoke(RestFn.java:397)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in central (https://repo1.maven.org/maven2/)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:355)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    at cemerick.pomegranate.aether$resolve_dependencies_STAR_.invokeStatic(aether.clj:806)
    at cemerick.pomegranate.aether$resolve_dependencies_STAR_.doInvoke(aether.clj:707)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:646)
    at clojure.core$apply.invoke(core.clj:641)
    at cemerick.pomegranate.aether$resolve_dependencies.invokeStatic(aether.clj:815)
    at cemerick.pomegranate.aether$resolve_dependencies.doInvoke(aether.clj:809)
    at clojure.lang.RestFn.invoke(RestFn.java:2793)
    at leiningen.core.classpath$get_dependencies_STAR_.invokeStatic(classpath.clj:273)
    ... 38 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in central (https://repo1.maven.org/maven2/)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:338)
    ... 53 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact com.google.firebase:firebase-database:jar:19.0.2 in central (https://repo1.maven.org/maven2/)
    at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:365)
    at org.eclipse.aether.util.concurrency.RunnableErrorForwarder.run(RunnableErrorForwarder.java:75)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
    ... 55 more

我的project.clj如下:

(defproject xxxxx "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [http-kit "2.3.0"]
                 [datascript "0.18.7"]
                 [com.google.firebase/firebase-database "19.0.2"]]
  :main ^:skip-aot xxxxx.xx
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all}}
  :repositories [["google" "https://maven.google.com/"]])

当然,实际的项目名称已替换为 x。

知道这个问题可能是什么吗?顺便说一下,我在 Ubuntu 18.04。

com.google.firebase:firebase-database:jar:19.0.2 不是 Firebase Admin SDK 的依赖项。那是 Firebase 实时数据库 Android 客户端 SDK。

documentation 所示,Java 的最新版本的 Firebase Admin SDK 是 com.google.firebase:firebase-admin:6.11.0.