Deadbolt 2.5 - 导入 SBT 项目时出错

Deadbolt 2.5 - Error while importing SBT project

抱歉我的英语不好..

今天我想在我的项目中实现 Deadbolt。 我阅读了这个 webstite 中的文档,但一开始我遇到了问题。

在第一条指令中,它说我需要在我的 built.sbt 文件中添加这些行。

libraryDependencies ++= Seq(
"be.objectify" %% "deadbolt-scala" % "2.5.1-SNAPSHOT"
)

resolvers += Resolver.sonatypeRepo("snapshots")




我使用 IntellijIDEA,当我刷新项目时出现此错误。

SBT 'Simulateur' project refresh failed Error:Error:Error while importing SBT project:

[info] Resolving com.typesafe.play#play-doc_2.11;1.2.2 ...

[info] Resolving org.pegdown#pegdown;1.4.0 ...

[info] Resolving org.parboiled#parboiled-java;1.1.5 ...

[info] Resolving org.parboiled#parboiled-core;1.1.5 ...

[info] Resolving org.ow2.asm#asm;4.1 ...

[info] Resolving org.ow2.asm#asm-tree;4.1 ...

[info] Resolving org.ow2.asm#asm-analysis;4.1 ...

[info] Resolving org.ow2.asm#asm-util;4.1 ...

[info] Resolving jline#jline;2.12.1 ...

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] :: UNRESOLVED DEPENDENCIES ::

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[warn] :: be.objectify#deadbolt-scala_2.11;2.5.1-SNAPSHOT: not found

[warn] ::::::::::::::::::::::::::::::::::::::::::::::

[trace] Stack trace suppressed: run 'last *:update' for the full output.

[trace] Stack trace suppressed: run 'last :ssExtractDependencies' for the full output.

[error] (
:update) sbt.ResolveException: unresolved dependency:be.objectify#deadbolt-scala_2.11;2.5.1-SNAPSHOT: not found

[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: be.objectify#deadbolt-scala_2.11;2.5.1-SNAPSHOT: not found

[error] Total time: 18 s, completed 20 déc. 2016 22:00:15

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0

See complete log in C:\Users\PCDamien.IntelliJIdea2016.2\system\log\sbt.last.log




现在我将展示我的 built.sbt 文件

name := "Simulateur"

version := "1.0"

lazy val `simulateur` = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq( jdbc , cache , ws   , specs2 % Test, "be.objectify" %% "deadbolt-scala" % "2.5.1-SNAPSHOT" )

unmanagedResourceDirectories in Test <+=  baseDirectory ( _ /"target/web/public/test" )  

resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"

resolvers += Resolver.sonatypeRepo("snapshots")

routesGenerator := StaticRoutesGenerator

提前感谢您的帮助! :)

对不起,这完全是我的错。我几天前发布了 2.5.1,当我将文档从 beta 移动到 final 时忘记更新版本。

正确的依赖关系是

libraryDependencies ++= Seq(
  "be.objectify" %% "deadbolt-scala" % "2.5.1"
)

这已在您引用的 web site 中得到更正。