我有一個基於Play框架2.0.4構建的應用程序。我想將它遷移到最新版本(目前是2.2.0)。從Play framework 2.0.4遷移到2.2.0
所以我已經更新了我的本地播放框架安裝,所有建立相應的文件:
build.properties:
sbt.version=0.13.0
Build.scala:
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "demagog"
val appVersion = "1.0.0"
val appDependencies = Seq(
javaCore,
"com.google.code.morphia" % "morphia" % "0.99",
"com.google.code.morphia" % "morphia-logging-slf4j" % "0.99",
"net.tanesha.recaptcha4j" % "recaptcha4j" % "0.0.7"
)
val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here
resolvers += "Morphia repository" at "http://morphia.googlecode.com/svn/mavenrepo/"
)
}
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("com.typesafe.play" % "sbt-plugin" % "2.2.0")
然後我試圖「消除」我的項目。所以,我剛好運行這兩個命令:
play clean-all
play eclipse
,我得到很多的錯誤,如:
[error] ..\Api.java:11: error: package org.codehaus.jackson does not exist
import org.codehaus.jackson.JsonNode;
預計由於我在Migration guide發現:
We have upgraded Jackson to version 2 which means that the package name is now com.fasterxml.jackson.core instead of org.codehaus.jackson.
但在「玩蝕」命令結束時,我得到這個錯誤:
[error] (compile:compile) javac returned nonzero exit code
[error] Could not create Eclipse project files:
[error] Error evaluating task 'dependencyClasspath': error
所以這個項目並沒有被「eclipsified」,我不能在Eclipse IDE中使用它或者編輯它。在Eclipse IDE以外的背景下進行編譯確實非常痛苦,並且阻止了我使用Play框架的高效工作: -/
你是否考慮過將所有從'org.codehaus.jackson'進口到'com.fasterxml.jackson.core'的進口? – tehlexx
那麼,由於新的2.2.0 API,我的整個應用程序有大約50個錯誤。我想用類路徑中的所有引用庫創建eclipse項目,這樣我就可以在Eclipse IDE中修復這些錯誤,而不是在文本編輯器中逐一修復。 – Behnil