当前位置: 首页 > 知识库问答 >
问题:

com.eed3si9n#sbt-汇编的库依赖关系;0.13.0:未找到

楚流觞
2023-03-14

我正在构建一个sbt插件,并希望在sbt汇编插件中引用汇编任务(取决于我的任务)

要做到这一点,我需要将它作为一个库(而不是插件)引用,不知何故,sbt无法将它作为一个库dedencies来解析

这就是我的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]  ::::::::::::::::::::::::::::::::::::::::::::::

共有3个答案

万俟渝
2023-03-14

除了上述建议之外,我还要补充一点

resolvers += Resolver.url("bintray-sbt-plugins", url("http://dl.bintray.com/sbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns)

项目/插件。sbt。

邵凯定
2023-03-14

在我的例子中,将sbt程序集版本从14.3修改为14.5就成功了。请检查一下什么是你的,试试看。

因此,在项目\程序集中。sbt,就像-

addSbtPlugin("com.eed3si9n"%"sbt-汇编"%"0.14.3")

然后我把它改成-

添加SBTPlugin(“com.eed3si9n”%“sbt组件”%“0.14.5”)

希望有帮助!

景康安
2023-03-14

由于未指定scala版本,因此无法解析。应该是这样的:

libraryDependencies ++= Seq(
    "com.eed3si9n" % "sbt-assembly_2.11" % "0.13.0"
)

或者,要自动获取project中使用的scala版本,请执行以下操作:

libraryDependencies ++= Seq(
    // notice the double %% here
    "com.eed3si9n" %% "sbt-assembly" % "0.13.0"
)

但是,sbt汇编不应该以这种方式安装。文档显示您必须将以下行添加到您的项目/plugins.sbt中:

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.2")

如果开发sbt插件,addSbtPlugin行必须直接进入/建筑sbt

 类似资料: