问题描述
我想使用 sbt-scrooge 插件,但它的 repo 现在不可用 - http://koofr.github.com/.
I want to use the sbt-scrooge plugin, but its repo is unavailable now - http://koofr.github.com/.
我想我会将这个插件的源代码直接包含在我自己的仓库中(作为 git 子模块).
I thought I'd include this plugin's source code directly in my own repo (as a git submodule).
我试过了:
git submodule add https://github.com/bancek/sbt-scrooge.git project/sbt-scrooge
并添加:
addSbtPlugin("net.koofr" % "sbt-scrooge" % "3.0.45")
到project/plugins.sbt
.但它不起作用 - 抛出以下异常:
to project/plugins.sbt
. But it doesn't work - the following exception is thrown:
sbt.ResolveException:未解析的依赖项:net.koofr#sbt-scrooge;3.0.45:未找到
正确的做法是什么?
我知道我可以将 sbt-scrooge 检出到本地文件系统,然后 sbt publish-local
,并将本地 ivy2
存储库添加到 sbt 作为解析器.但我只想知道是否有其他方法可以做到这一点.
I know that I could checkout sbt-scrooge to the local filesystem, then sbt publish-local
, and add the local ivy2
repo to sbt as a resolver. But I just want to know whether there are other ways to do this.
推荐答案
如解释 在这里你可以把它放在你的project/plugins.sbt
中:
As explained here you can puth this in your project/plugins.sbt
:
lazy val root = project.in(file(".")).dependsOn(scroogePlugin)
lazy val scroogePlugin = file("sbt-scrooge")
或者简单地(不创建本地子模块):
Or simply (without creating a local submodule):
lazy val root = project.in(file(".")).dependsOn(scroogePlugin)
lazy val scroogePlugin = uri("https://github.com/bancek/sbt-scrooge.git")
这篇关于当只有插件的源可用时,如何在 sbt 项目中使用插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!