akka-spray-websocket模板构建错误

时间:2015-02-05 14:44:09

标签: scala intellij-idea sbt spray

我对TypeSafe的这些模板有一点问题,当我尝试在IntelliJ中导入它时,我收到以下消息错误:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: io.spray#sbt-revolver;0.7.2: not found
[warn]  :: com.typesafe.sbt#sbt-aspectj;0.10.1: not found
[warn]  :: com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0: not found
[warn]  :: com.timushev.sbt#sbt-updates;0.1.7: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]      io.spray:sbt-revolver:0.7.2 (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.typesafe.sbt:sbt-aspectj:0.10.1 (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.typesafe.sbteclipse:sbteclipse-plugin:2.5.0 (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.timushev.sbt:sbt-updates:0.1.7 (sbtVersion=0.13, scalaVersion=2.10)
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      io.spray:sbt-revolver:0.7.2 (sbtVersion=0.13, scalaVersion=2.10) (C:\Users\jlopesde\akka-spray-websocket\project\plugins.sbt#L1-2)
[warn]        +- default:akka-spray-websocket-build:0.1-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.typesafe.sbt:sbt-aspectj:0.10.1 (sbtVersion=0.13, scalaVersion=2.10) (C:\Users\jlopesde\akka-spray-websocket\project\plugins.sbt#L3-4)
[warn]        +- default:akka-spray-websocket-build:0.1-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.typesafe.sbteclipse:sbteclipse-plugin:2.5.0 (sbtVersion=0.13, scalaVersion=2.10) (C:\Users\jlopesde\akka-spray-websocket\project\plugins.sbt#L5-6)
[warn]        +- default:akka-spray-websocket-build:0.1-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
[warn]      com.timushev.sbt:sbt-updates:0.1.7 (sbtVersion=0.13, scalaVersion=2.10) (C:\Users\jlopesde\akka-spray-websocket\project\plugins.sbt#L7-8)
[warn]        +- default:akka-spray-websocket-build:0.1-SNAPSHOT (sbtVersion=0.13, scalaVersion=2.10)
sbt.ResolveException: unresolved dependency: io.spray#sbt-revolver;0.7.2: not found
unresolved dependency: com.typesafe.sbt#sbt-aspectj;0.10.1: not found
unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0: not found
unresolved dependency: com.timushev.sbt#sbt-updates;0.1.7: not found
[error] (*:update) sbt.ResolveException: unresolved dependency: io.spray#sbt-revolver;0.7.2: not found
[error] unresolved dependency: com.typesafe.sbt#sbt-aspectj;0.10.1: not found
[error] unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;2.5.0: not found
[error] unresolved dependency: com.timushev.sbt#sbt-updates;0.1.7: not found

我知道导入它有问题,可能Spray或Scala的版本不正确,但我不知道如何解决它。你能否提供一些处理这类问题的技巧?

由于

我的build.sbt:

organization  := "cua.li"

version       := "0.4"

scalaVersion  := "2.11.5"

libraryDependencies ++= {
  val akkaV  = "2.3.9"
  val sprayV = "1.3.2"
  val kamonV = "0.3.5"
  Seq(
    "com.wandoulabs.akka" %%  "spray-websocket"       % "0.1.4"           withSources() withJavadoc,
    "io.spray"            %%  "spray-json"            % "1.3.1"           withSources() withJavadoc,
    "io.spray"            %%  "spray-can"             % sprayV            withSources() withJavadoc,
    "io.spray"            %%  "spray-routing"         % sprayV            withSources() withJavadoc,
    "com.typesafe.akka"   %%  "akka-actor"            % akkaV             withSources() withJavadoc,
    "com.typesafe.akka"   %%  "akka-slf4j"            % akkaV             withSources() withJavadoc,
    /*
    "org.aspectj"         %   "aspectjweaver"         % "1.8.4"           withSources() withJavadoc,
    "io.kamon"            %%  "kamon-core"            % kamonV            withSources() withJavadoc,
    "io.kamon"            %%  "kamon-spray"           % kamonV            withSources() withJavadoc,
    "io.kamon"            %%  "kamon-statsd"          % kamonV            withSources() withJavadoc,
    "io.kamon"            %%  "kamon-log-reporter"    % kamonV            withSources() withJavadoc,
    "io.kamon"            %%  "kamon-system-metrics"  % kamonV            withSources() withJavadoc,
    "io.kamon"            %%  "kamon-testkit"         % kamonV   % "test" withSources() withJavadoc,
    // */
    "com.typesafe.akka"   %%  "akka-testkit"          % akkaV    % "test" withSources() withJavadoc,
    "io.spray"            %%  "spray-testkit"         % sprayV   % "test" withSources() withJavadoc,
    "org.scalatest"       %%  "scalatest"             % "2.2.3"  % "test",
    "junit"               %   "junit"                 % "4.12"   % "test",
    "org.specs2"          %%  "specs2"                % "2.4.15" % "test",
    "ch.qos.logback"      %   "logback-classic"       % "1.1.2"
  )
}

scalacOptions ++= Seq("-deprecation", "-encoding", "UTF-8", "-feature", "-target:jvm-1.7", "-unchecked",
  "-Ywarn-adapted-args", "-Ywarn-value-discard", "-Xlint")

javacOptions ++= Seq("-Xlint:deprecation", "-Xlint:unchecked", "-source", "1.7", "-target", "1.7", "-g:vars")

doc in Compile <<= target.map(_ / "none")

publishArtifact in (Compile, packageSrc) := false

logBuffered in Test := false

Keys.fork in Test := false

parallelExecution in Test := false

seq(Revolver.settings: _*)

import com.typesafe.sbt.SbtAspectj._

aspectjSettings

fork in run := true

javaOptions <++= AspectjKeys.weaverOptions in Aspectj

2 个答案:

答案 0 :(得分:2)

可能缺少下载依赖项的存储库。

尝试将它放在libraryDependencies之前:

resolvers ++= Seq(
  "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
  "Spray repository"    at "http://repo.spray.io/",
  "Scalaz Bintray Repo" at "http://dl.bintray.com/scalaz/releases"
)

答案 1 :(得分:0)

我有同样的问题,但只有sbt-revolver。我通过以下方式设法解决了这个问题:

我的SBT设置为使用我的Artifactory实例来检索依赖项。

1)在Artifactory中,我将下面的存储库添加到&#34; Remote Repositories&#34;并使其成为&#34; remote-repos&#34;虚拟存储库。

http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases

2)在我的〜/ .sbt / repositories文件中,我确保我的Artifactory存储库配置了正确的URL格式(请参见下文)。我已采用SBT's documentation格式。

artifactory-ivy: http://my.artifactory.com:8081/artifactory/repo/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]