我已经为了使这个工作而努力了太多,我知道这个问题两年前就提出了,但我认为我们可以从回答它中受益。
根据Coursier的cs fetch --help
:
--repository | -r <maven|sonatype:$repo|ivy2local|bintray:$org/$repo|bintray-ivy:$org/$repo|typesafe:ivy-$repo|typesafe:$repo|sbt-plugin:$repo|scala-integration|scala-nightlies|ivy:$pattern|jitpack|clojars|jcenter|apache:$repo>
Repository - for multiple repositories, separate with comma and/or add this option multiple times (e.g. -r central,ivy2local -r sonatype:snapshots, or equivalently -r central,ivy2local,sonatype:snapshots)
(也许在提出这个问题时不是这种情况)可以在Ivy存储库前缀中加入ivy。从这个帮助文档中真正不清楚的是如何同时提供自定义服务器和模式,但实际上非常简单,您必须将两者连接在参数中:
cs fetch --no-default --repository http://myivyrepo.tld/joint-ivy-releases/[org]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext]
Coursier的内部解析器将负责检测哪部分是URL,哪部分是模式。
如果有人感兴趣,所有负责的代码都位于coursier中的IvyRepository.parse函数中。
此外,可以向coursier提供metadataPattern(我不知道那是什么)来为ivy分隔它们,方法是在后面加上一个|。
cs fetch --no-default --repository http://myivyrepo.tld/joint-ivy-releases/[org]/[module]/[baseRev](-[folderItegRev])/[module]-[baseRev](-[fileItegRev])(-[classifier]).[ext]|<YOUR_METADATA_OPTS>