【问题标题】:play framework migrate to 2.1.1 gives me a headacheplay framework migrate to 2.1.1 让我头疼
【发布时间】:2013-04-22 05:24:13
【问题描述】:

所以我想开始做一个我5个月前放弃的游戏框架项目,该项目仍然是2.0.4版本,看到2.1.1是我做这个教程更新项目的最新版本:@ 987654321@。 (除了做 addSbtPlugin("play" % "sbt-plugin" % "2.1.1") 来匹配当前版本)

但是一旦我尝试做干净的游戏,我就会收到这个错误:

[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.
[error] Note that conflicts were resolved for some dependencies:
[error]     asm:asm
[error]     asm:asm-tree
[error]     asm:asm-util
[error]     jline:jline
[error]     junit:junit
[error]     com.jcraft:jsch
[error]     commons-logging:commons-logging
[error]     commons-codec:commons-codec
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 

除了这个link,我在这个话题上找不到太多,但我真的不明白是什么解决了那里的问题,显然提问者也没有。我还尝试在迁移教程中添加所有示例依赖项,但没有任何改变。

这是可以解决的还是我应该恢复到 2.0.4?

EDIT 1-5-12' 添加了配置文件,我认为没有什么异常

构建.scala

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {

    val appName         = "Workshop0182Host"
    val appVersion      = "1.0-SNAPSHOT"

    val appDependencies = Seq(
      // Add your project dependencies here,
    )

    val main = play.Project(appName, appVersion, appDependencies).settings(
      // Add your own project settings here      
    )

}

plugins.sbt

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"


// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1.1")

build.properties

sbt.version=0.12.2

我尝试过 addSbtPlugin("play" % "sbt-plugin" % "2.1.0") 但后来 play clean 只是说 addSbtPlugin 使用了错误的版本。 play clean-all 运行良好,但之后没有任何变化

EDIT 1-5-12' 添加日志

当我尝试运行play cleanplay run 时,这是一个指向错误日志的链接(pastebin),我认为问题与 scala 版本有关,但我不知道从哪里开始在那里。

【问题讨论】:

  • 试试play clean-all 看看是否有帮助。
  • 如果play clean 失败,只需删除target 文件夹即可。它具有相同的效果。
  • 你使用任何自定义的 sbt 插件吗?
  • @Marius Soutier 不,我没有

标签: java scala playframework playframework-2.0 sbt


【解决方案1】:

我也遇到过同样的问题,都是sbt版和play版的。所以在project/build.properties你必须有sbt.version=0.12.2project/plugins.sbtaddSbtPlugin("play" % "sbt-plugin" % "2.1.0")然后

play clean
play ~run

尝试使用 2.0.4 版本从头开始创建新项目,然后将其迁移到 2.1.0

无论如何,很高兴看到您的配置文件。

【讨论】:

  • 所以即使我使用的是 play 版本 2.1.1,我也必须在 plugins.sbt 中使用 2.1.0?
  • 没错,你需要使用sbt-plugin 2.1.0
  • 然后我明白了:这个项目使用的是 Play 2.1.0!将 Play sbt-plugin 版本更新为 2.1.1(通常在 project/plugins.sbt 中)
  • 对不起,我在考虑 2.1.0 并且写了一个愚蠢的东西,如果你使用 play 2.1.1 而不是 sbt-plugin 也是 2.1.1。我刚刚尝试过,效果很好。您是否尝试使用 play-2.1.1 从头开始​​创建一个新项目并运行它,因为它适合您?
【解决方案2】:

我遇到了类似的问题,我必须更改 project/plugins.sbt 才能处理从 github 存储库中提取的项目

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1.2")

    // Use the Play sbt plugin for Play projects
   addSbtPlugin("play" % "sbt-plugin" % "2.1.0")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-27
    • 1970-01-01
    相关资源
    最近更新 更多