我查看了基于Play的Scala项目!框架。
当我为项目启动sbt
时,它会失败(请参阅下面的日志。)
当我为sample Play! Scala project尝试相同时 - 一切正常(sbt
启动,eclipse
命令生成Eclipse项目。)
此外,我的同事声称他在不同的机器上使用该项目没有问题。
[info] Loading global plugins from C:\Users\ADMIN\.sbt\0.13\plugins
[info] Loading project definition from C:\Users\ADMIN\git\labor-api\project
[info] Updating {file:/C:/Users/ADMIN/git/labor-api/project/}labor-api-build...
[info] Resolving org.scala-sbt#global-plugins;0.0 ...
[info] Resolving com.typesafe.sbteclipse#sbteclipse-plugin;5.1.0 ...
[info] Resolving org.scalaz#scalaz-core_2.10;7.2.5 ...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scalaz#scalaz-effect_2.10;7.2.5 ...
[info] Resolving com.typesafe.play#sbt-plugin;2.5.+ ...
[info] Resolving com.typesafe.play#sbt-plugin;2.5.+ ...
[warn] module not found: com.typesafe.play#sbt-plugin;2.5.+
[warn] ==== typesafe-ivy-releases: tried
[warn] https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/[revision]/ivys/ivy.xml
[warn] [2.4-2014-08-19-5fd9847, 2.4-2014-08-18-5fd9847, 2.4-2014-08-17-5fd9847, 2.4-2014-08-16-03f91eb, 2.4-2014-08-15-b08854b, 2.4-2014-08-14-8f1ab55, 2.4-2014-08-13-7c7ce8a, 2.4-2014-08-12-e68eb09, 2.4-2014-08-11-dd2d4b1, 2.4-2014-08-10-8e2d199, 2.4-2014-08-09-8e2d199, 2.4-2014-08-08-8e2d199, 2.4-2014-08-07-c30c96d, 2.4-2014-08-06-7c41056, 2.4-2014-08-05-9a580bb, 2.4-2014-08-04-4548968, 2.4-2014-08-03-62c0309, 2.4-2014-08-02-fbea58a, 2.4-2014-08-01-5b94b4a, 2.4-2014-07-31-36fb6e2, 2.4-2014-07-30-36fb6e2, 2.4-2014-07-29-4647d65, 2.4-2014-07-28-bc4bc11, 2.4-2014-07-27-97af747, 2.4-2014-07-26-6ce3cef, 2.4-2014-07-25-6ce3cef, 2.4-2014-07-24-7216074, 2.4-2014-07-23-7216074, 2.4-2014-07-22-3c93c30, 2.4-2014-07-21-02e0575, 2.4-2014-07-20-5ff0e81, 2.4-2014-07-19-79f69d9, 2.4-2014-07-18-bda4f8c, 2.4-2014-07-17-baae840, 2.4-2014-07-16-02d2926, 2.4-2014-07-15-8044c94, 2.4-2014-07-14-a590178, 2.4-2014-07-13-a590178, 2.4-2014-07-12-a590178, 2.4-2014-07-11-0afaea0, 2.4-2014-07-10-331e305, 2.4-2014-07-09-0f876a4, 2.4-2014-07-08-9ad6ec5, 2.4-2014-07-07-45240bf, 2.4-2014-07-06-ce2dfb3, 2.4-2014-07-05-a6fe863, 2.4-2014-07-04-a6fe863, 2.4-2014-07-03-0fb3c88, 2.4-2014-07-02-157e8b3, 2.4-2014-07-01-01a501e, 2.4-2014-06-30-a37d3cc, 2.4-2014-06-29-5094d7a, 2.4-2014-06-28-5094d7a, 2.4-2014-06-27-5094d7a, 2.4-2014-06-26-760704d, 2.4-2014-06-25-db4a398, 2.4-2014-06-24-b8c2254, 2.4-2014-06-23-ebcf2bb, 2.4-2014-06-22-b644dbf, 2.4-2014-06-21-b644dbf, 2.4-2014-06-20-3aed064, 2.4-2014-06-19-bf049f5, 2.4-2014-06-18-9282597, 2.4-2014-06-17-4a1fede, 2.4-2014-06-16-2e25c69, 2.4-2014-06-15-2e25c69, 2.4-2014-06-14-ea7daf3, 2.4-2014-06-13-2fa2b2b, 2.4-2014-06-12-2fa2b2b, 2.4-2014-06-11-bd5be36, 2.4-2014-06-10-52ab2bb, 2.4-2014-06-09-7710fb0, 2.4-2014-06-08-7710fb0, 2.4-2014-06-07-177faff, 2.4-2014-06-06-177faff, 2.4-2014-06-05-84bb608, 2.4-2014-06-04-7dd0229, 2.4-2014-06-03-7dd0229, 2.4-2014-06-02-75daadf, 2.4-2014-06-01-75daadf, 2.4-2014-05-31-6b07c6e, 2.4-2014-05-30-2c50a2c, 2.4-2014-05-29-7713919, 2.4-2014-05-28-1534d66, 2.4-2014-05-27-28f1001, 2.4-2014-05-26-c5d6152, 2.4-2014-05-25-3712b6c, 2.4-2014-05-24-3712b6c, 2.4-2014-05-23-c896edc, 2.4-2014-05-22-a2e72c6, 2.4-2014-05-21-77e0bc9, 2.4-2014-05-20-652b307, 2.4-2014-05-19-97b0ee0, 2.4-2014-05-18-9e8cbdb, 2.4-2014-05-17-be37f8a, 2.4-2014-05-16-be37f8a, 2.4-2014-05-15-69b2537, 2.4-2014-05-15-b4f8cc8, 2.4.0-RC1, 2.4.0-T2, 2.4.0-M3, 2.4.0-M2, 2.4.0-M1, 2.4-stagingtest, 2.3-20131213005945Z, 2.3-2014-07-18-watch-service-patch, 2.3.8-7591330ccd513dfef0a95faf605197b852c3940a, 2.3.8-849efbeeafbb875ebe1f6567094e58d9c09eeb55, 2.3.8-423b33e6a6bfd89abe4122051e26995977a1365f, 2.3.8-96d1003d8219fc35ffdedd8828184ee833d7f758, 2.3.8-65d700c8158a8d3e390380c6a214d85707b96768, 2.3.8-52d9403c7c1a06bb7f8cd89706588bf691f24987, 2.3.8-26cc07bb21bdf7b58140d15e23dc5eae37434999, 2.3.8-7bcacef5bc2e41f5f20ba821778471c3552ea917, 2.3.8-6bf5e68cd80eb54e6fdfc6544748b89e3e2c096c, 2.3.8-4c54458f5e54ff63ff58554de5f6099ecede7cd1, 2.3.8-2eefdea13fed88a535e1a76bd077b272f4228e08, 2.3.8-2de45b3774b6757f4aae980f8b5b152c1d2b73a5, 2.3.8, 2.3.8-f58978fd93861251689fdac71f1deb3d614def1a, 2.3.8-eccc45e728592c42a2b7e8821b09d1f50f4cbcb4, 2.3.8-a1a26fd7cebf49d2dad13fa3e4e0c940b15d129b, 2.3.8-M7, 2.3.8-M6, 2.3.8-M5, 2.3.8-M4, 2.3.8-M3, 2.3.8-M2, 2.3.8-M1, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.2-RC2, 2.3.2-RC1, 2.3.1, 2.3.0, 2.3.0-RC2, 2.3.0-RC1, 2.3.x-41a245d3b74efe0c739347d31b04dc5c2d5e3457, 2.3.x-e92419dbabb6b626dcf9c0945670e7ebb5ca8ac7, 2.3-M1, 2.2.6, 2.2.5, 2.2.4, 2.2.3, 2.2.3-RC2, 2.2.3-RC1, 2.2.2, 2.2.2-RC4, 2.2.2-RC3, 2.2.2-RC2, 2.2.2-RC1, 2.2.1, 2.2.1-RC1, 2.2.1.nr.2, 2.2.1.nr.1, 2.2.1.ncl.1, 2.2.1-ge, 2.2.0, 2.2.0-RC2, 2.2.0-RC1, 2.2.0-M3, 2.2.0-M2, 2.0.6]
[warn] ==== sbt-plugin-releases: tried
[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/[revision]/ivys/ivy.xml
[warn] ==== local: tried
[warn] C:\Users\ADMIN\.ivy2\local\com.typesafe.play\sbt-plugin\scala_2.10\sbt_0.13\[revision]\ivys\ivy.xml
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.10_0.13/[revision]/sbt-plugin-[revision].pom
[info] Resolving org.scala-sbt#sbt;0.13.11 ...
[info] Resolving org.scala-sbt#main;0.13.11 ...
[info] Resolving org.scala-sbt#actions;0.13.11 ...
[info] Resolving org.scala-sbt#classpath;0.13.11 ...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.6 ...
[info] Resolving org.scala-sbt#interface;0.13.11 ...
[info] Resolving org.scala-sbt#io;0.13.11 ...
[info] Resolving org.scala-sbt#control;0.13.11 ...
[info] Resolving org.scala-sbt#launcher-interface;1.0.0-M1 ...
[info] Resolving org.scala-sbt#completion;0.13.11 ...
[info] Resolving org.scala-sbt#collections;0.13.11 ...
[info] Resolving jline#jline;2.13 ...
[info] Resolving org.fusesource.jansi#jansi;1.11 ...
[info] Resolving org.scala-sbt#api;0.13.11 ...
[info] Resolving org.scala-sbt#classfile;0.13.11 ...
[info] Resolving org.scala-sbt#logging;0.13.11 ...
[info] Resolving org.scala-sbt#process;0.13.11 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.11 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.11 ...
[info] Resolving org.scala-sbt#relation;0.13.11 ...
[info] Resolving org.scala-sbt#compile;0.13.11 ...
[info] Resolving org.scala-sbt#persist;0.13.11 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.11 ...
[info] Resolving org.scala-sbt#ivy;0.13.11 ...
[info] Resolving org.scala-sbt#cross;0.13.11 ...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cc8d2761242b072cedb0a04cb39435c4fa24f9a ...
[info] Resolving com.jcraft#jsch;0.1.46 ...
[info] Resolving org.scala-sbt#serialization_2.10;0.1.2 ...
[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.1 ...
[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...
[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...
[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...
[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...
[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...
[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.11 ...
[info] Resolving org.scala-sbt#task-system;0.13.11 ...
[info] Resolving org.scala-sbt#tasks;0.13.11 ...
[info] Resolving org.scala-sbt#tracking;0.13.11 ...
[info] Resolving org.scala-sbt#cache;0.13.11 ...
[info] Resolving org.scala-sbt#testing;0.13.11 ...
[info] Resolving org.scala-sbt#test-agent;0.13.11 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.11 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.11 ...
[info] Resolving org.scala-sbt#command;0.13.11 ...
[info] Resolving org.scala-sbt#logic;0.13.11 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.11 ...
[info] Resolving org.scala-lang#jline;2.10.6 ...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.play#sbt-plugin;2.5.+: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] com.typesafe.play:sbt-plugin:2.5.+ (scalaVersion=2.10, sbtVersion=0.13)
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.typesafe.play:sbt-plugin:2.5.+ (scalaVersion=2.10, sbtVersion=0.13) (C:\Users\ADMIN\git\labor-api\project\plugins.sbt#L2-3)
[warn] +- default:labor-api-build:0.1-SNAPSHOT (scalaVersion=2.10, sbtVersion=0.13)
sbt.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.5.+: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:313)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
at sbt.IvySbt.withIvy(Ivy.scala:128)
at sbt.IvySbt.withIvy(Ivy.scala:125)
at sbt.IvySbt$Module.withModule(Ivy.scala:156)
at sbt.IvyActions$.updateEither(IvyActions.scala:168)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1439)
at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1435)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1470)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$90.apply(Defaults.scala:1468)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1473)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1467)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:1490)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1417)
at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1369)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:277)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:522)
at java.util.concurrent.FutureTask.run(FutureTask.java:277)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.5.+: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
[更新] 我注意到一个类似的问题on google group,但它不适用 - 我不在代理之后。网络运行正常。
[更新2] 在另一台机器(家用工作站)上尝试 - 结果相同:
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.lang.Thread.run(Thread.java:785)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.5.+: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
这是我使用的sbt
版本(从项目外部目录运行,因为sbt
无法在项目目录中启动:
C:\temp>sbt about
[info] Set current project to temp (in build file:/C:/temp/)
[info] This is sbt 0.13.11
[info] The current project is {file:/C:/temp/}temp 0.1-SNAPSHOT
[info] The current project is built against Scala 2.10.6
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin
[info] sbt, sbt plugins, and build definitions are using Scala 2.10.6
[更新3]
一些配置文件:
build.sbt
name := "labor-api"
version := "1.0"
EclipseKeys.withSource := true
scalaVersion := "2.11.8"
scalacOptions ++= Seq(
"-target:jvm-1.8",
"-deprecation",
"-encoding", "UTF-8",
"-unchecked",
// "-Xfatal-warnings",
"-feature",
"-language:implicitConversions",
"-language:postfixOps",
"-Ywarn-dead-code"
)
libraryDependencies ++= Seq(
// "org.scala-lang" % "scala-reflect" % scalaVersion.value,
// "com.h2database" % "h2" % "1.4.185",
"ch.qos.logback" % "logback-classic" % "1.1.2",
// "joda-time" % "joda-time" % "2.6",
// "org.joda" % "joda-convert" % "1.2",
"com.typesafe.play" %% "play-slick" % "2.0.+",
"com.typesafe.slick" %% "slick" % "3.1.+",
"org.suecarter" %% "freeslick" % "3.1.+",
// "com.typesafe.play" %% "play-json" % "2.5.+",
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test)
// Play
lazy val root = (project in file(".")).enablePlugins(PlayScala, LauncherJarPlugin)
项目/ plugins.sbt
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.+")
项目\ build.properties
sbt.version=0.13.11
答案 0 :(得分:2)
通过替换来解决问题 的项目\ plugins.sbt 强>
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.+")
与
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.10")
答案 1 :(得分:0)
您似乎正在使用scala 2.10,根据https://www.playframework.com/documentation/2.5.x/Migration25,它与Play 2.5不兼容。发生的事情是,sbt正在寻找插件的scala 2.10版本,它无法找到它。您应该更改build.sbt文件以使用更新的scala版本。
然而,所有这些都是一个猜想,因为您没有指定您检出的项目,因此我无法对其进行测试。