3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Play!Framework2.0.4から2.2.4へのmigration

Posted at

特徴

  • sbt versionの変更により、Build.scalaへの編集が必要になる点をフォロー

ダウンロードとパス設定

解凍後ディレクトリ構成

> tree
C:.
└───play-2.0.4
└───play-2.2.4

パス設定

> set
・・・
- PLAY_HOME=C:\play-2.0.4;
+ PLAY_HOME=C:\play-2.2.4;
Path=%PLAY_HOME%;・・・
・・・

ファイルの編集

使用するsbtのバージョン更新

/project/build.properties
-sbt.version=0.11.3
+sbt.version=0.13.0

sbt用Playプラグイン更新

/project/plugins.sbt
-addSbtPlugin("play" % "sbt-plugin" % "2.0.4")
+addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

PlayProjectオブジェクト変更対応

  • Play 2.0 の PlayProject オブジェクト が Play 2.1 で play.Projectに
  • 依存に"jdbc"、"anorm"追加
  • コンストラクタの引数が変更され、"mainLang = SCA"削除
  • PostgreSQL利用の場合はgroupIDも変更
/project/Build.scala
-import PlayProject._
+import play.Project._

・・・
    val appVersion      = "1.0"

    val appDependencies = Seq(
        // Add your project dependencies here,
-        "postgresql" % "postgresql" % "9.1-901-1.jdbc4"
+        jdbc, anorm,
+        "org.postgresql" % "postgresql" % "9.3-1100-jdbc4"
    )

-    val main = PlayProject(
-        appName, appVersion, appDependencies, mainLang = SCA
+    val main = play.Project(
+        appName, appVersion, appDependencies
    ).settings(
        // Add your own project settings here
    )

play clean

> play clean
・・・
[success] Total time: 0 s, completed yyyy/MM/dd hh:mm:ss
  • jdk1.8+の場合、Permanent領域が削除されたため以下警告が出る。
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256M; sup
port was removed in 8.0
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?