当我想查找例如 ragtime 的可用版本时,我会运行以下命令
clj -X:deps find-versions :lib ragtime/ragtime
;; the output
{:mvn/version "0.6.2"}
{:mvn/version "0.6.3"}
{:mvn/version "0.6.4"}
{:mvn/version "0.7.0"}
{:mvn/version "0.7.1"}
{:mvn/version "0.7.2"}
{:mvn/version "0.8.0"}
{:mvn/version "0.8.1"}
然而,当省略 groupid 时,tools.deps 将引发 NullPointerException。 示例命令
clj -X:deps find-versions :lib ragtime
Execution error (NullPointerException) at java.util.regex.Matcher/getTextLength (Matcher.java:1283).
null
以及堆栈跟踪
{:clojure.main/message
"Execution error (NullPointerException) at java.util.regex.Matcher/getTextLength (Matcher.java:1283).\nnull\n",
:clojure.main/triage
{:clojure.error/class java.lang.NullPointerException,
:clojure.error/line 1283,
:clojure.error/symbol java.util.regex.Matcher/getTextLength,
:clojure.error/source "Matcher.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.NullPointerException,
:at [java.util.regex.Matcher getTextLength "Matcher.java" 1283]}],
:trace
[[java.util.regex.Matcher getTextLength "Matcher.java" 1283]
[java.util.regex.Matcher reset "Matcher.java" 309]
[java.util.regex.Matcher <init> "Matcher.java" 229]
[java.util.regex.Pattern matcher "Pattern.java" 1093]
[clojure.core$re_matcher invokeStatic "core.clj" 4881]
[clojure.core$re_matches invokeStatic "core.clj" 4911]
[clojure.core$re_matches invoke "core.clj" 4911]
[clojure.tools.deps.extensions.git$auto_git_url$fn__1454
invoke
"git.clj"
31]
[clojure.core$some invokeStatic "core.clj" 2718]
[clojure.core$some invoke "core.clj" 2709]
[clojure.tools.deps.extensions.git$auto_git_url
invokeStatic
"git.clj"
30]
[clojure.tools.deps.extensions.git$auto_git_url invoke "git.clj" 23]
[clojure.tools.deps.extensions.git$eval1534$fn__1535
invoke
"git.clj"
152]
[clojure.lang.MultiFn invoke "MultiFn.java" 244]
[clojure.tools.deps.extensions$find_all_versions$fn__446
invoke
"extensions.clj"
149]
[clojure.core$some invokeStatic "core.clj" 2718]
[clojure.core$some invoke "core.clj" 2709]
[clojure.tools.deps.extensions$find_all_versions
invokeStatic
"extensions.clj"
149]
[clojure.tools.deps.extensions$find_all_versions
invoke
"extensions.clj"
145]
[clojure.tools.deps.cli.api$find_versions
invokeStatic
"api.clj"
399]
[clojure.tools.deps.cli.api$find_versions invoke "api.clj" 379]
[clojure.lang.Var invoke "Var.java" 384]
[clojure.run.exec$exec invokeStatic "exec.clj" 89]
[clojure.run.exec$exec invoke "exec.clj" 78]
[clojure.run.exec$_main$fn__219 invoke "exec.clj" 216]
[clojure.run.exec$_main invokeStatic "exec.clj" 212]
[clojure.run.exec$_main doInvoke "exec.clj" 180]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]]}}
Cli 版本: "1.11.1.1262"。
最好的祝福,
Sanel