Unresolved Dependencies sbt with play framework

南楼画角 提交于 2021-01-28 09:14:32

问题


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.

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")

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"
)

but i get the following error output

 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:\Users\Dexter66\.ivy2\local\com.typesafe.sbt\sbt-play-ebean\scala_2.11\sbt_0.13\3.0.0\ivys\ivy.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:\Users\Dexter66\Desktop\Uebungsprojekte_Play\play-java-starter-examp
le-2.5.x - Kopie\plugin.sbt#L1-2)
[warn]            +- play-java:play-java_2.11:1.0-SNAPSHOT
[info] Wrote C:\Users\Dexter66\Desktop\Uebungsprojekte_Play\play-java-starter-example-2.5.x - Kopie\target\scala-2.11\play-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


回答1:


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

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

from this line:

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

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

(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"

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



来源:https://stackoverflow.com/questions/49201488/unresolved-dependencies-sbt-with-play-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!