这里是Scala的新手,我有这个.sbt清单文件:
import sbt.Package._
import sbt._
import Docker.autoImport.exposedPorts
scalaVersion := "2.12.6"
enablePlugins(DockerPlugin)
exposedPorts := Seq(8666)
libraryDependencies ++= Vector (
Library.vertx_lang_scala,
Library.vertx_web,
Library.scalaTest % "test",
// Uncomment for clustering
// Library.vertx_hazelcast,
//required to get rid of some warnings emitted by the scala-compile
Library.vertx_codegen
)
packageOptions += ManifestAttributes(
("Main-Verticle", "scala:vertx.scala.myapp.HttpVerticle"))
我运行以下命令:
sbt clean compile
和大多数与JVM相关的工具一样,我得到大约1000行输出:
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/oleg/codes/oresoftware/vertx-scala/project
[info] Updating {file:/home/oleg/codes/oresoftware/vertx-scala/project/}vertx-scala-build...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.eed3si9n#sbt-assembly;0.14.5: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.5 {compile=[default(compile)]}::
[warn] 1
[warn] 1
[warn] 1
[warn] :: com.lucidchart#sbt-scalafmt;1.14: Resolution failed several times for dependency: com.lucidchart#sbt-scalafmt;1.14 {compile=[default(compile)]}::
[warn] 1
[warn] 1
[warn] 1
[warn] :: org.scoverage#sbt-scoverage;1.5.1: Resolution failed several times for dependency: org.scoverage#sbt-scoverage;1.5.1 {compile=[default(compile)]}::
[warn] 1
[warn] 1
[warn] 1
[warn] :: net.virtual-void#sbt-dependency-graph;0.9.0: Resolution failed several times for dependency: net.virtual-void#sbt-dependency-graph;0.9.0 {compile=[default(compile)]}::
[warn] 1
[warn] 1
[warn] 1
[warn] :: se.marcuslonnberg#sbt-docker;1.5.0: Resolution failed several times for dependency: se.marcuslonnberg#sbt-docker;1.5.0 {compile=[default(compile)]}::
[warn] 1
[warn] 1
[warn] 1
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.eed3si9n:sbt-assembly:0.14.5 (scalaVersion=2.12, sbtVersion=1.0)
[warn] org.scoverage:sbt-scoverage:1.5.1 (scalaVersion=2.12, sbtVersion=1.0)
[warn] com.lucidchart:sbt-scalafmt:1.14 (scalaVersion=2.12, sbtVersion=1.0)
[warn] se.marcuslonnberg:sbt-docker:1.5.0 (scalaVersion=2.12, sbtVersion=1.0)
[warn] net.virtual-void:sbt-dependency-graph:0.9.0 (scalaVersion=2.12, sbtVersion=1.0)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.eed3si9n:sbt-assembly:0.14.5 (scalaVersion=2.12, sbtVersion=1.0) (/home/oleg/codes/oresoftware/vertx-scala/project/plugins.sbt#L1-2)
[warn] +- default:vertx-scala-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] org.scoverage:sbt-scoverage:1.5.1 (scalaVersion=2.12, sbtVersion=1.0) (/home/oleg/codes/oresoftware/vertx-scala/project/plugins.sbt#L3-4)
[warn] +- default:vertx-scala-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] com.lucidchart:sbt-scalafmt:1.14 (scalaVersion=2.12, sbtVersion=1.0) (/home/oleg/codes/oresoftware/vertx-scala/project/plugins.sbt#L2-3)
[warn] +- default:vertx-scala-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] se.marcuslonnberg:sbt-docker:1.5.0 (scalaVersion=2.12, sbtVersion=1.0) (/home/oleg/codes/oresoftware/vertx-scala/project/plugins.sbt#L5-6)
[warn] +- default:vertx-scala-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[warn] net.virtual-void:sbt-dependency-graph:0.9.0 (scalaVersion=2.12, sbtVersion=1.0) (/home/oleg/codes/oresoftware/vertx-scala/project/plugins.sbt#L4-5)
[warn] +- default:vertx-scala-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.5: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.5 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: com.lucidchart#sbt-scalafmt;1.14: Resolution failed several times for dependency: com.lucidchart#sbt-scalafmt;1.14 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: org.scoverage#sbt-scoverage;1.5.1: Resolution failed several times for dependency: org.scoverage#sbt-scoverage;1.5.1 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: net.virtual-void#sbt-dependency-graph;0.9.0: Resolution failed several times for dependency: net.virtual-void#sbt-dependency-graph;0.9.0 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: se.marcuslonnberg#sbt-docker;1.5.0: Resolution failed several times for dependency: se.marcuslonnberg#sbt-docker;1.5.0 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] at sbt.internal.librarymanagement.IvyActions$.resolveAndRetrieve(IvyActions.scala:331)
[error] at sbt.internal.librarymanagement.IvyActions$.$anonfun$updateEither$1(IvyActions.scala:205)
[error] at sbt.internal.librarymanagement.IvySbt$Module.$anonfun$withModule$1(Ivy.scala:229)
[error] at sbt.internal.librarymanagement.IvySbt.$anonfun$withIvy$1(Ivy.scala:190)
[error] at sbt.internal.librarymanagement.IvySbt.sbt$internal$librarymanagement$IvySbt$$action$1(Ivy.scala:70)
[error] at sbt.internal.librarymanagement.IvySbt$$anon$3.call(Ivy.scala:77)
[error] at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:95)
[error] at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:80)
[error] at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:99)
[error] at xsbt.boot.Using$.withResource(Using.scala:10)
[error] at xsbt.boot.Using$.apply(Using.scala:9)
[error] at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:60)
[error] at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:50)
[error] at xsbt.boot.Locks$.apply0(Locks.scala:31)
[error] at xsbt.boot.Locks$.apply(Locks.scala:28)
[error] at sbt.internal.librarymanagement.IvySbt.withDefaultLogger(Ivy.scala:77)
[error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:185)
[error] at sbt.internal.librarymanagement.IvySbt.withIvy(Ivy.scala:182)
[error] at sbt.internal.librarymanagement.IvySbt$Module.withModule(Ivy.scala:228)
[error] at sbt.internal.librarymanagement.IvyActions$.updateEither(IvyActions.scala:190)
[error] at sbt.librarymanagement.ivy.IvyDependencyResolution.update(IvyDependencyResolution.scala:20)
[error] at sbt.librarymanagement.DependencyResolution.update(DependencyResolution.scala:56)
[error] at sbt.internal.LibraryManagement$.resolve$1(LibraryManagement.scala:38)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$12(LibraryManagement.scala:91)
[error] at sbt.util.Tracked$.$anonfun$lastOutput$1(Tracked.scala:68)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$19(LibraryManagement.scala:104)
[error] at scala.util.control.Exception$Catch.apply(Exception.scala:224)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11(LibraryManagement.scala:104)
[error] at sbt.internal.LibraryManagement$.$anonfun$cachedUpdate$11$adapted(LibraryManagement.scala:87)
[error] at sbt.util.Tracked$.$anonfun$inputChanged$1(Tracked.scala:149)
[error] at sbt.internal.LibraryManagement$.cachedUpdate(LibraryManagement.scala:118)
[error] at sbt.Classpaths$.$anonfun$updateTask$5(Defaults.scala:2353)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:42)
[error] at sbt.std.Transform$$anon$4.work(System.scala:64)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:257)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] at sbt.Execute.work(Execute.scala:266)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:257)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:167)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:32)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
[error] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
[error] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[error] at java.base/java.lang.Thread.run(Thread.java:844)
[error] (*:update) sbt.librarymanagement.ResolveException: unresolved dependency: com.eed3si9n#sbt-assembly;0.14.5: Resolution failed several times for dependency: com.eed3si9n#sbt-assembly;0.14.5 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: com.lucidchart#sbt-scalafmt;1.14: Resolution failed several times for dependency: com.lucidchart#sbt-scalafmt;1.14 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: org.scoverage#sbt-scoverage;1.5.1: Resolution failed several times for dependency: org.scoverage#sbt-scoverage;1.5.1 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: net.virtual-void#sbt-dependency-graph;0.9.0: Resolution failed several times for dependency: net.virtual-void#sbt-dependency-graph;0.9.0 {compile=[default(compile)]}::
[error] 1
[error] 1
[error] 1
[error]
[error] unresolved dependency: se.marcuslonnberg#sbt-docker;1.5.0: Resolution failed several times for dependency: se.marcuslonnberg#sbt-docker;1.5.0 {compile=[default(compile)]}::
[error] 1
[error] 1
有人知道为什么我通过以下方法创建的基本项目框架吗?
sbt new vert-x3/vertx-scala.g8
不编译吗?
更新,据说我缺少的是一些插件,这里是project/plugins.sbt
:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.14")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph"% "0.9.0")
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.5.0")