我尝试将Play框架从2.1.4迁移到2.2.6,我根据迁移文档更改了plugins.sbt和build.properties。
addSbtPlugin(" com.typesafe.play"%" sbt-plugin"%" 2.2.6")
sbt.version = 0.13.0
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "Test-App"
val appVersion = "1.0-SNAPSHOT"
val appDependencies: Seq[sbt.ModuleID] = Seq(
javaCore, javaJdbc, javaEbean,
"postgresql" % "postgresql" % "8.4-702.jdbc4",
"com.wordnik" % "swagger-play2_2.10" % "1.3.6"
)
val main = play.Project(appName, appVersion,
appDependencies).settings(
ebeanEnabled := true,
sources in doc in Compile := List()
)
}
我在编译时遇到了以下异常,
[error] Modules were resolved with conflicting cross-version suffixes in {file:/home/Test-App/}Test-App:
[error] org.scala-stm:scala-stm _2.10, _2.10.0
java.lang.RuntimeException: Conflicting cross-version suffixes in: org.scala-stm:scala-stm
at scala.sys.package$.error(package.scala:27)
at sbt.ConflictWarning$.processCrossVersioned(ConflictWarning.scala:47)
at sbt.ConflictWarning$.apply(ConflictWarning.scala:30)
at sbt.Classpaths$$anonfun$61.apply(Defaults.scala:1027)
at sbt.Classpaths$$anonfun$61.apply(Defaults.scala:1027)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
我找到了一些解决方案,例如使用exclude
删除scala-stm"dependencyGroupId" %% "dependencyArtifactId" % "dependencyVersion" exclude("org.scala-stm", "scala-stm_2.10.0")
我试过这样的, " org.scala-STM" %" scala-stm_2.10" %" 2.2.6"排除(" org.scala-stm"," scala-stm_2.10.0")
但我得到了依赖未解决的异常,
[info] Updating {file:/home/Test-App}Test-App...
[info] Resolving org.scala-stm#scala-stm_2.10;2.2.6 ...
[warn] module not found: org.scala-stm#scala-stm_2.10;2.2.6
[warn] ==== local: tried
[warn] /opt/play/repository/local/org.scala-stm/scala-stm_2.10/2.2.6
/ivys/ivy.xml
[warn] ==== Maven2 Local: tried
[warn] file:/home/Test-App/.m2/repository/org/scala-stm/scala-stm_2.10
/2.2.6/scala-stm_2.10-2.2.6.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-stm/scala-stm_2.10/2.2.6
/scala-stm_2.10-2.2.6.pom
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/org/scala-stm/scala-
stm_2.10/2.2.6/scala-stm_2.10-2.2.6.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-stm#scala-stm_2.10;2.2.6: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.scala-stm#scala-
stm_2.10;2.2.6: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:213)
这里我不知道什么是dependencyGroupId,对于org.scala-stm的dependencyArtifactId?请帮我解决这个问题..