np-hard np-hard - 1 month ago 16
Scala Question

libraryDependencies for com.eed3si9n#sbt-assembly;0.13.0: not found

I am building a sbt plugin and want to reference assembly task in the sbt-assembly plugin ( to be dependent on my task)

to do this i need to reference it as a library ( as opposed to a plugin), and somehow sbt is not able to resolve it as a libraryDepdendencies

this is what my sbt looks like

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")


the output looks like

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] ::::::::::::::::::::::::::::::::::::::::::::::

Answer

It is not resolving because you did not specify a scala version. It should be something like:

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

Or, to automatically get the scala version used in project:

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

But, sbt-assembly is not supposed to be installed that way. The docs show that you must add the following line to your project/plugins.sbt instead:

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

If developing an sbt plugin, the addSbtPlugin line has to go directly into ./build.sbt.

Comments