我正在尝试在Docker之上构建最简单的游戏,但没有这样做。
该应用程序在Intelij上运行良好,但是在构建docker文件时-在解决sbt依赖关系时-无法解决com.typesafe.play:sbt-plugin:2.6.20
我发现sbt尝试解析的链接没有打开,实际上似乎有点: https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.10_0.13/2.6.20/sbt-plugin-2.6.20.pom
如果您搜索存储库树,则会发现: https://repo1.maven.org/maven2/com/typesafe/play/play_2.12/2.6.20/play_2.12-2.6.20.pom
我还在InteliJ的构建日志中看到它可以从此处解析: https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/
包括
的构建日志server_1_5b1cd8eac7c5 | [info] Loading project definition from /app-src/project
server_1_5b1cd8eac7c5 | [info] Set current project to app-src (in build file:/app-src/)
server_1_5b1cd8eac7c5 | [warn] module not found: com.typesafe.play#sbt-plugin;2.6.20
server_1_5b1cd8eac7c5 | [warn] ==== local: tried
server_1_5b1cd8eac7c5 | [warn] /root/.ivy2/local/com.typesafe.play/sbt-plugin/scala_2.10/sbt_0.13/2.6.20/ivys/ivy.xml
server_1_5b1cd8eac7c5 | [warn] ==== public: tried
server_1_5b1cd8eac7c5 | [warn] https://repo1.maven.org/maven2/com/typesafe/play/sbt-plugin_2.10_0.13/2.6.20/sbt-plugin-2.6.20.pom
server_1_5b1cd8eac7c5 | [warn] ==== local-preloaded-ivy: tried
server_1_5b1cd8eac7c5 | [warn] /root/.sbt/preloaded/com.typesafe.play/sbt-plugin/2.6.20/ivys/ivy.xml
server_1_5b1cd8eac7c5 | [warn] ==== local-preloaded: tried
server_1_5b1cd8eac7c5 | [warn] file:////root/.sbt/preloaded/com/typesafe/play/sbt-plugin_2.10_0.13/2.6.20/sbt-plugin-2.6.20.pom
server_1_5b1cd8eac7c5 | [warn] ::::::::::::::::::::::::::::::::::::::::::::::
server_1_5b1cd8eac7c5 | [warn] :: UNRESOLVED DEPENDENCIES ::
server_1_5b1cd8eac7c5 | [warn] ::::::::::::::::::::::::::::::::::::::::::::::
server_1_5b1cd8eac7c5 | [warn] :: com.typesafe.play#sbt-plugin;2.6.20: not found
server_1_5b1cd8eac7c5 | [warn] ::::::::::::::::::::::::::::::::::::::::::::::
server_1_5b1cd8eac7c5 | [warn]
server_1_5b1cd8eac7c5 | [warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
server_1_5b1cd8eac7c5 | [warn] com.typesafe.play:sbt-plugin:2.6.20 (scalaVersion=2.10, sbtVersion=0.13)
server_1_5b1cd8eac7c5 | [warn]
server_1_5b1cd8eac7c5 | [warn] Note: Unresolved dependencies path:
server_1_5b1cd8eac7c5 | [warn] com.typesafe.play:sbt-plugin:2.6.20 (scalaVersion=2.10, sbtVersion=0.13) (/app-src/plugins.sbt#L4-5)
server_1_5b1cd8eac7c5 | [warn] +- default:app-src_2.10:0.1-SNAPSHOT
server_1_5b1cd8eac7c5 | sbt.ResolveException: unresolved dependency: com.typesafe.play#sbt-plugin;2.6.20: not found
server_1_5b1cd8eac7c5 | at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:320)
server_1_5b1cd8eac7c5 | at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
server_1_5b1cd8eac7c5 | at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
server_1_5b1cd8eac7c5 | at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
server_1_5b1cd8eac7c5 | at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
server_1_5b1cd8eac7c5 | at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
server_1_5b1cd8eac7c5 | at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
server_1_5b1cd8eac7c5 | at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
server_1_5b1cd8eac7c5 | at xsbt.boot.Using$.withResource(Using.scala:10)
server_1_5b1cd8eac7c5 | at xsbt.boot.Using$.apply(Using.scala:9)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$.apply0(Locks.scala:31)
server_1_5b1cd8eac7c5 | at xsbt.boot.Locks$.apply(Locks.scala:28)
server_1_5b1cd8eac7c5 | at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
server_1_5b1cd8eac7c5 | at sbt.IvySbt.withIvy(Ivy.scala:128)
server_1_5b1cd8eac7c5 | at sbt.IvySbt.withIvy(Ivy.scala:125)
server_1_5b1cd8eac7c5 | at sbt.IvySbt$Module.withModule(Ivy.scala:156)
server_1_5b1cd8eac7c5 | at sbt.IvyActions$.updateEither(IvyActions.scala:168)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1555)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1551)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1586)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$122.apply(Defaults.scala:1584)
server_1_5b1cd8eac7c5 | at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1589)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1583)
server_1_5b1cd8eac7c5 | at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$.cachedUpdate(Defaults.scala:1606)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1533)
server_1_5b1cd8eac7c5 | at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1485)
server_1_5b1cd8eac7c5 | at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
server_1_5b1cd8eac7c5 | at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
server_1_5b1cd8eac7c5 | at sbt.std.Transform$$anon$4.work(System.scala:63)
server_1_5b1cd8eac7c5 | at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
server_1_5b1cd8eac7c5 | at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
server_1_5b1cd8eac7c5 | at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
server_1_5b1cd8eac7c5 | at sbt.Execute.work(Execute.scala:237)
server_1_5b1cd8eac7c5 | at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
server_1_5b1cd8eac7c5 | at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
server_1_5b1cd8eac7c5 | at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
server_1_5b1cd8eac7c5 | at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
server_1_5b1cd8eac7c5 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
server_1_5b1cd8eac7c5 | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
server_1_5b1cd8eac7c5 | at java.util.concurrent.FutureTask.run(FutureTask.java:266)
server_1_5b1cd8eac7c5 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
server_1_5b1cd8eac7c5 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
server_1_5b1cd8eac7c5 | at java.lang.Thread.run(Thread.java:748)
server_1_5b1cd8eac7c5 | [error] (*:update) sbt.ResolveException: unresolved dependency: com
同时包含build.sbt和plugins.sbt(主要是与intelij玩锅炉项目一起使用):
build.sbt:
name := "intro"
version := "1.0"
lazy val `intro` = (project in file(".")).enablePlugins(PlayScala)
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"
scalaVersion := "2.12.6"
libraryDependencies ++= Seq( jdbc , ehcache , ws , specs2 % Test , guice)
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "2.5.0"
unmanagedResourceDirectories in Test <+= baseDirectory ( _ /"target/web/public/test" )
plugins.sbt
logLevel := Level.Warn
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20")
请注意,我尝试了很多左轮手枪,直到在网上发现都没有运气。
note2:提到sbt都提到Intelij项目就可以了
顺便说一句,如果您对docker文件感兴趣,可以在这里找到: https://github.com/levgou/table-handler/blob/master/intro_server/Dockerfile
编辑:问题是,我没有将build.sbt复制到我的docker目录中,并且发现其他一些.sbt错误地出现了(对不起我)
答案 0 :(得分:0)
请确保您检查了scala版本。在该链接中,它尝试下载不存在的2.10版本的库,而下载2.12版本的库。