我正在构建一个sbt插件,并想在sbt-assembly插件中引用组装任务(取决于我的任务)
为此,我需要将其引用为库(而不是插件),而sbt无法将其解析为库
这就是我的sbt的样子
sbtPlugin := true
name := "my-sbt-plugin"
scalaVersion := "2.10.6"
sbtVersion := "0.13.0"
resolvers ++= Seq(Resolver.sbtPluginRepo("releases"), Resolver.sbtPluginRepo("snapshots"))
libraryDependencies ++= Seq(
"com.eed3si9n" % "sbt-assembly" % "0.13.0")
输出看起来像
Resolving com.eed3si9n#sbt-assembly;0.13.0 ...
[warn] module not found: com.eed3si9n#sbt-assembly;0.13.0
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/myuser/.ivy2/local/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/eed3si9n/sbt-assembly/0.13.0/sbt-assembly-0.13.0.pom
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[warn] ==== sbt-plugin-snapshots: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/com.eed3si9n/sbt-assembly/0.13.0/ivys/ivy.xml
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.eed3si9n#sbt-assembly;0.13.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
最佳答案
由于您未指定Scala版本,因此无法解决。应该是这样的:
libraryDependencies ++= Seq(
"com.eed3si9n" % "sbt-assembly_2.11" % "0.13.0"
)
或者,要自动获取项目中使用的scala版本:
libraryDependencies ++= Seq(
// notice the double %% here
"com.eed3si9n" %% "sbt-assembly" % "0.13.0"
)
但是,不应以这种方式安装sbt-assembly。您必须在
project/plugins.sbt
中添加以下行的docs show代替:addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.2")
如果开发sbt插件,
addSbtPlugin
行必须直接进入./build.sbt
。
关于scala - com.eed3si9n#sbt-assembly的libraryDependencies; 0.13.0 : not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35756520/