2015-08-03 40 views
3

我怎樣才能在編譯使用SORM斯卡拉2.11.6, 我收到以下錯誤SORM:如何使用SORM在斯卡拉2.11.6

[error] Modules were resolved with conflicting cross-version suffixes in ... 
[error] org.scala-lang.modules:scala-xml _2.11, _2.12.0-M1 
[error] org.scala-lang.modules:scala-parser-combinators _2.11, _2.12.0-M1 

在我build.sbt我使用...

name := "api-psi" 

version := "1.0-SNAPSHOT" 

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

scalaVersion := "2.11.6" 

libraryDependencies ++= Seq(
    "com.h2database" % "h2" % "1.4.177", 
    "org.sorm-framework" % "sorm" % "0.3.18", 
    "org.webjars" % "bootstrap" % "3.3.5", 
    specs2 % Test 
) 

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

routesGenerator := InjectedRoutesGenerator 

我想這個例子:https://www.youtube.com/watch?v=eNCerkVyQdcI,但在任何時候,他進口SORM ...

夥計們,我設法解決...

要解決這個矛盾,你應該明確你的常春藤緩存:

~/.ivy2/cache 

但是你也想修復斯卡拉編譯器使用的版本,你想讓它匹配您的配置scalaVersion:

dependencyOverrides += "org.scala-lang" % "scala-compiler" % scalaVersion.value 

現在我SBT

name := """api-my-psi""" 

version := "1.0-SNAPSHOT" 

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

scalaVersion := "2.11.6" 

libraryDependencies ++= Seq(
    jdbc, 
    cache, 
    ws, 
    specs2 % Test, 
    "org.sorm-framework" % "sorm" % "0.3.18", 
    "org.webjars" % "webjars-play_2.11" % "2.4.0-1", 
    "org.webjars" % "bootstrap" % "3.3.5" 
) 

dependencyOverrides += "org.scala-lang" % "scala-compiler" % scalaVersion.value 

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

routesGenerator := InjectedRoutesGenerator 
+0

我編輯我的答案這應該解決這個問題 – anquegi

+0

我有相同的問題和清理緩存不起作用。目前我正在使用臨時解決方案,只需在build.sbt文件中添加「conflictWarning:= ConflictWarning.disable」這一行。有用。 – Luke

+0

您的解決方案有效! –

回答

1

我覺得現在的問題是行

「org.scala琅」 % 「的Scala庫」 % 「2.11.6」

刪除它,因爲斯卡拉版建議立即進行刪除在你的SBT這樣的:

name := "your name app" 

version := "your version" 

scalaVersion := "2.11.6" 

libraryDependencies ++= Seq(
    "org.sorm-framework" % "sorm" % "0.3.18" 
) 

創建一個帶有激活器的新遊戲應用程序,因爲它顯示了玩框架,這是build.sbt添加sorm的依賴關係:,請同時刪除.ivy/cache中的文件也許是一些在線離線依賴關係,

我也認爲問題出在sc特有的webjars依賴性上阿拉2.11,我做了這個編譯使用Java 8但這不是在這種情況下相關的,重要的認爲這是中階的版本爲您的依賴試試這個:

name := """TestStackOverflow""" 

version := "1.0-SNAPSHOT" 

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

scalaVersion := "2.11.6" 

libraryDependencies ++= Seq(
    jdbc, 
    cache, 
    ws, 
    specs2 % Test, 
    "org.sorm-framework" % "sorm" % "0.3.18", 
    "org.webjars" % "webjars-play_2.11" % "2.4.0-1", 
    "org.webjars" % "bootstrap" % "3.3.5" 
) 

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

// Play provides two styles of routers, one expects its actions to be injected, the 
// other, legacy style, accesses its actions statically. 
routesGenerator := InjectedRoutesGenerator 
+0

是的anquegi,我想建立一個播放框架的應用程序,並希望在內部使用sorm框架? –

+0

檢查編輯我的答案這應該工作 – anquegi

+0

好的。但是...我得到相同的錯誤... –