未解决的依赖关系 sbt with play framework [英] Unresolved Dependencies sbt with play framework

查看:47
本文介绍了未解决的依赖关系 sbt with play framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我是 Stack Overflow 的新手,请耐心等待,我正在使用 Play 2.5 进行项目,这正是网站上的入门示例.

As i am new to Stack Overflow please be patient i am working on a project with Play 2.5 exactly the starter example from the Website.

因为我必须使用 ebean,所以我遵循了在 plugins.sbt 中设置 ebean 的步骤,就像

As i have to work with ebean i followed the Steps of Setting ebean in the plugins.sbt as like

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.0")

也在我的 build.sbt 文件中

and also in my build.sbt file

name := """play-java"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)

scalaVersion := "2.11.11"

libraryDependencies += javaJdbc
libraryDependencies += cache
libraryDependencies += javaWs
libraryDependencies += filters
libraryDependencies += evolutions

libraryDependencies ++= Seq(
  "mysql" % "mysql-connector-java" % "5.1.18",
  "org.webjars"               %% "webjars-play"       % "2.3.0",
  "org.webjars"               % "bootstrap"           % "3.0.0" exclude("org.webjars", "jquery"),
  "org.webjars"               % "jquery"              % "1.8.3"
)

但我得到以下错误输出

 Resolving com.typesafe.sbt#sbt-play-ebean;3.0.0 ...
[warn]  module not found: com.typesafe.sbt#sbt-play-ebean;3.0.0
[warn] ==== local: tried
[warn]   C:UsersDexter66.ivy2localcom.typesafe.sbtsbt-play-ebeanscala_2.11sbt_0.133.0.0ivysivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/com/typesafe/sbt/sbt-play-ebean_2.11_0.13/3.0.0/sbt-play-ebean-3.0.0.pom
[info] Resolving jline#jline;2.14.3 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.sbt#sbt-play-ebean;3.0.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
[warn]          com.typesafe.sbt:sbt-play-ebean:3.0.0 (scalaVersion=2.11, sbtVersion=0.13)
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]          com.typesafe.sbt:sbt-play-ebean:3.0.0 (scalaVersion=2.11, sbtVersion=0.13) (C:UsersDexter66DesktopUebungsprojekte_Playplay-java-starter-examp
le-2.5.x - Kopieplugin.sbt#L1-2)
[warn]            +- play-java:play-java_2.11:1.0-SNAPSHOT
[info] Wrote C:UsersDexter66DesktopUebungsprojekte_Playplay-java-starter-example-2.5.x - Kopie	argetscala-2.11play-java_2.11-1.0-SNAPSHOT.pom
sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-play-ebean;3.0.0: 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:1488)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1484)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1519)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1517)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1522)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1516)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1539)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1466)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1418)
        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(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbt#sbt-play-ebean;3.0.0: not found

Cannot start with errors.

我也尝试过文件描述的方式-->无效缓存/重启但也没有帮助

I also tried already the described way of File-->invalid caches/restart but also did not help

推荐答案

我认为你的问题出在 sbt 的 scala 版本上.
sbt 0.13 适用于 scala 2.10,sbt 1.0 适用于 scala 2.12

I think your problem is with the scala version of the sbt.
sbt 0.13 works with scala 2.10, and sbt 1.0 works with scala 2.12

您使用的所有插件都必须与 sbt 处于相同的 scala 版本中

all plugins that you use must be in the same scala version as the sbt

从这一行开始:

com.typesafe.sbt:sbt-play-ebean:3.0.0 (scalaVersion=2.11, sbtVersion=0.13)

com.typesafe.sbt:sbt-play-ebean:3.0.0 (scalaVersion=2.11, sbtVersion=0.13)

我了解到您使用的是 sbt 0.13.x,但在某处将 scala 版本设置为 2.11.x

I understand that you are using sbt 0.13.x, but somewhere set the scala version to 2.11.x

(可能在 project/build.sbtproject/plugins.sbt 中)
你不应该在这些文件中设置 scala 版本

(maybe in project/build.sbt or project/plugins.sbt)
you shouldn't set the scala version in those files

澄清一下,我不是在谈论

to clarify, I'm not talking about the

scalaVersion := "2.11.11"

你的 build.sbt 里有,没问题.
我说的是 sbt 进程的 scala 版本,它是自己的

that you have in your build.sbt, it is fine.
I'm talking about the scala version of the sbt process it's self

这篇关于未解决的依赖关系 sbt with play framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆