SOURCE https://github.com/playframework/playframework/blob/2e56aff7d4e7a74af61e4bd39ec9e3ed7f300cd6/documentation/manual/releases/release29/migration29/Migration29.md
SHA256 1fc83c67a0c29b20bb877df24ca7a2e7dc07a98bc15cfe1ef12ad0148ffecff6
25: Play 2.9 only supports sbt 1.9 or newer. To update, change your `project/build.properties` so that it reads:
26: 
27: ```properties
28: sbt.version=1.9.6
29: ```
30: 
31: At the time of this writing `1.9.6` is the latest version in the sbt 1.x family, you may be able to use newer versions too. Check the release notes for sbt's [releases](https://github.com/sbt/sbt/releases) for details.
32: 
33: ### Minimum required Java and sbt version
34: 
35: Play 2.9 dropped Java 8 support and requires at least Java 11. Other supported Java versions are 17 and 21. When upgrading to Play 2.9, we strongly recommend considering an upgrade to at least Java 17 LTS. It’s worth noting that in the forthcoming Play 2.x release, which will be version 2.10, we are likely to discontinue support for Java 11.
36: 
37: > Please be aware that binding an HTTPS port with a self-signed certificate in Java 17 and Java 21 may lead to issues. For more details on this matter, refer to [["Generation of Self-Signed Certificates Fails in Java 17 and Java 21"|Migration29#Generation-of-Self-Signed-Certificates-Fails-in-Java-17-and-Java-21]].
38: 
39: ### Jetty ALPN Agent removed
40: 
41: Because Java 11 is the minimum required Java versions for Play 2.9 and supports ALPN out of the box, the [Jetty ALPN Agent](https://github.com/jetty-project/jetty-alpn-agent), is not strictly required anymore.
42: In case you passed a `-javaagent:jetty-alpn-agent-*.jar` flag to your Play application(s) (maybe via `SBT_OPTS` environment variable) you have to remove that flags now.
43: 
44: ### Upgrading Akka and Akka HTTP
45: 
46: If you wish to upgrade beyond Akka 2.6 and Akka HTTP 10.2, you can do that with the assistance of our [Play Scala](https://www.playframework.com/documentation/2.9.x/ScalaAkka#Updating-Akka-version) or [Play Java](https://www.playframework.com/documentation/2.9.x/JavaAkka#Updating-Akka-version) update guides. We also strongly encourage you to review:
47: 
48: - [[How Play Deals with Akka’s License Change|General#How-Play-Deals-with-Akkas-License-Change]]
49: 
50: ## API Changes
51: 
52: Play 2.9 contains multiple API changes. As usual, we follow our policy of deprecating existing APIs before removing them. This section details these changes.
53: 
54: ### Scala 2.12 support discontinued
55: 
56: Play 2.9 supports Scala 2.13 and Scala 3.3, but not 2.12 anymore. Scala 3 requires some more migration steps which you can find in our [[Scala 3 migration guide|Scala3Migration]].
57: 
58: ### Setting `scalaVersion` in your project
59: 
60: **Both Scala and Java users** must configure sbt to use a supported Scala version. Even if you have no Scala code in your project, Play itself uses Scala and must be configured to use the right Scala libraries.
61: 
62: To set the Scala version in sbt, simply set the `scalaVersion` key, for example:
63: 
64: ```scala
65: scalaVersion := "2.13.15"
66: ```
67: 
68: Play 2.9 also supports Scala 3:
69: 
70: ```scala
71: scalaVersion := "3.3.4"
116: Following classes have been renamed:
117: 
118: | **Deprecated class** | **New class**               |
119: |----------------------|-----------------------------|
120: | `HttpExecutionContext` | `ClassLoaderExecutionContext` |
121: | `HttpExecution`        | `ClassLoaderExecution`        |
122: 
123: ### Deprecated APIs were removed
124: 
SOURCE https://github.com/playframework/playframework/blob/2e56aff7d4e7a74af61e4bd39ec9e3ed7f300cd6/documentation/manual/releases/release30/migration30/Migration30.md
SHA256 1a534dbc479f1ddc9e8003c9f69d0c680c778c5254bd76ab28f6cf8e6697d121
5: This is a guide for migrating from Play 2.9 to Play 3.0. If you need to migrate from an earlier version of Play, you must first follow the [[Play 2.9 Migration Guide|Migration29]].
6: 
7: ## How to migrate
8: 
9: Aside from switching from Akka to [Pekko](https://pekko.apache.org/) (more details [[here|General#How-Play-Deals-with-Akkas-License-Change]]), Play 3.0 offers identical features and bug fixes as in [[Play 2.9|Highlights29]]. Play 3.0 and 2.9 will receive the same features and bug fixes and are maintained in parallel. Since these two major releases are nearly identical, we refer you to the [[Play 2.9 Migration Guide|Migration29]]. Please read through it and follow its steps to migrate from Play 2.8 to Play 2.9. Afterward, continue with the Play 3.0 specific migration notes below to complete the migration to Play 3.0. We also recommend reading through the [[Play 2.9 Highlights|Highlights29]] and [[Play 3.0 Highlights|Highlights30]] pages.
10: 
11: > As mentioned in the [[Play 2.9 Highlights|Highlights29]] and the [[2.9 Migration Guide|Migration29]], Play 2.9 and Play 3.0 both offer Scala 3 support. If you want to migrate your application to Scala 3, please follow the [[Scala 3 Migration Guide|Scala3Migration]] _after_ you finish migrating to Play 3.0.
12: 
13: ## Play 3.0 specific migration steps
14: 
15: In addition to the migration steps described in the [[Play 2.9 Migration Guide|Migration29]], there are specific steps you need to take to migrate to Play 3.0:
16: 
17: ### Changed `groupId`
18: 
19: With Play 3.0, we changed the `groupId` from `com.typesafe.play` to `org.playframework` to emphasize that Play is fully [community-driven](https://www.playframework.com/sponsors). If you use Play libraries as dependencies or make use of Play sbt plugins, you must update the `groupId` of those dependencies. There might be cases, although rare, where you might need to adjust imports in your code. See this comparison of how to update your build files and code:
20: 
21: Play 3.0
22: : ```sbt
23: // Dependencies:
24: libraryDependencies += "org.playframework" ...
25: // sbt plugins:
26: addSbtPlugin("org.playframework" ...
27: // Source code:
28: import org.playframework.*
29: ```
30: 
31: Play 2.9
32: : ```sbt
33: // Dependencies:
34: libraryDependencies += "com.typesafe.play" ...
35: // sbt plugins:
36: addSbtPlugin("com.typesafe.play" ...
37: // Source code:
38: import com.typesafe.play.*
39: ```
40: 
41: ### Play upgrade
42: 
43: In addition to the `groupId` change, you will also need to update the Play version number in `project/plugins.sbt`:
44: 
45: ```scala
46: addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.x")
71: 
72: Common renames in Scala and Java source files:
73: 
74: Play 3.0 using Pekko
75: : ```scala
76: // Imports:
77: import org.apache.pekko.*
78: // Changed packages in code:
79: org.apache.pekko.pattern.after(...)
80: // Class names:
81: Pekko.providerOf(...)
82: class MyModule extends AbstractModule with PekkoGuiceSupport { ... }
83: // Method names:
84: headers.convertRequestHeadersPekko(...)
85: ```
86: 
87: Play 2.9 using Akka
88: : ```scala
89: // Imports:
90: import akka.*
91: // Changed packages in code:
92: akka.pattern.after(...)
93: // Class names:
94: Akka.providerOf(...)
95: class MyModule extends AbstractModule with AkkaGuiceSupport { ... }
96: // Method names:
97: headers.convertRequestHeadersAkka(...)
98: ```
99: 
100: Common Configuration key renames (usually in `conf/application.conf`):
101: 
102: Play 3.0 using Pekko
103: : ```conf
104: pekko { }
105: pekko {
106:   loggers = ["org.apache.pekko.event.slf4j.Slf4jLogger"]
107:   logging-filter = "org.apache.pekko.event.slf4j.Slf4jLoggingFilter"
108: }
109: pekko.serialization { }
110: pekko.coordinated-shutdown { }
111: pekko.remote { }
112: play.pekko { }
113: play.pekko.dev-mode { }
114: play.pekko.dev-mode.pekko { }
115: promise.pekko.actor { }
116: ```
117: 
118: Play 2.9 using Akka
119: : ```conf
120: akka { }
121: akka {
122:   loggers = ["akka.event.slf4j.Slf4jLogger"]
123:   logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
124: }
125: akka.serialization { }
126: akka.coordinated-shutdown { }
127: akka.remote { }
128: play.akka { }
129: play.akka.dev-mode { }
130: play.akka.dev-mode.akka { }
131: promise.akka.actor { }
132: ```
133: 
134: Pay special attention to the server backend configuration if you were previously using Akka HTTP (the default):
135: 
136: Play 3.0 using Pekko
137: : ```conf
138: play.server {
139:       provider = "play.core.server.PekkoHttpServerProvider"
140:       pekko {
141:           server-header="PekkoHTTP Server"
142:           # With Http2 enabled:
143:           #server-header="PekkoHTTP Server Http2"
144:       }
145: }
146: ```
147: 
148: Play 2.9 using Akka
149: : ```conf
150: play.server {
151:       provider = "play.core.server.AkkaHttpServerProvider"
152:       akka {
153:           server-header="AkkaHTTP Server"
154:           # With Http2 enabled:
155:           #server-header="AkkaHTTP Server Http2"
156:       }
157: }
158: ```
188: Due to the switch to Pekko, two artifact names have also changed. Note that this is in addition to the `groupId` change to `org.playframework`:
189: 
190: Play 3.0 using Pekko
191: : ```sbt
192: "org.playframework" %% "play-pekko-http-server" % "3.0.0"
193: "org.playframework" %% "play-pekko-http2-support" % "3.0.0"
194: ```
195: 
196: Play 2.9 using Akka
197: : ```sbt
198: "com.typesafe.play" %% "play-akka-http-server" % "2.9.0"
199: "com.typesafe.play" %% "play-akka-http2-support" % "2.9.0"
SOURCE https://github.com/playframework/playframework/blob/2e56aff7d4e7a74af61e4bd39ec9e3ed7f300cd6/documentation/manual/releases/Scala3Migration.md
SHA256 4af40f3448e983bee949f6b764ec0c2f6dec2fa47b739d13677d56a1fd98ad5a
5: This guide is for migrating a Play application from Scala 2 to Scala 3 and requires that your application is already running on at least [[Play 2.9|Highlights29]] (built on Akka / Akka HTTP) or [[Play 3.0|Highlights30]] (built on Pekko / Pekko HTTP).
6: 
7: > Depending on your codebase, migrating existing Play applications to Scala 3 can be a substantial task. We strongly recommend that you initially [[migrate|Migration29]] to Play 2.9 or 3.0 while staying on Scala 2.13. This approach ensures that everything functions as intended. Afterward, you can make the transition to Scala 3.
8: 
9: ## General
10: 
11: In addition to the migration steps mentioned on this page, which cover the migration steps needed to move a Play Framework application to Scala 3, there are general Scala 3 resources that you want to follow to migrate your code base to Scala 3:
12: 
13: - The [Scala 3 Migration Guide](https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html)
14: - The [Scala 3 Language Reference](https://docs.scala-lang.org/scala3/reference/)
15: 
16: ## Setting `scalaVersion` in your project
17: 
18: **Both Scala and Java users** must configure sbt to use Scala 3. Even if you have no Scala code in your project, Play itself uses Scala and must be configured to use the right Scala libraries.
19: 
20: To set the Scala version in sbt, simply set the `scalaVersion` key, for example:
21: 
22: ```scala
23: scalaVersion := "3.3.4"
24: ```
25: 
SOURCE https://github.com/playframework/playframework/blob/2e56aff7d4e7a74af61e4bd39ec9e3ed7f300cd6/transport/server/play-pekko-http-server/src/main/scala/play/core/server/PekkoHttpServer.scala
SHA256 4187ffb4a7045ac92cf440b1452778389a066c1cc911defc2d3c05fedaf589fd
78:   /** Helper to access server configuration under the `play.server` prefix. */
79:   private val serverConfig = context.config.configuration.get[Configuration]("play.server")
80: 
81:   /** Helper to access server configuration under the `play.server.pekko` prefix. */
82:   private val pekkoServerConfig = serverConfig.get[Configuration]("pekko")
83: 
84:   private val pekkoServerConfigReader = new PekkoServerConfigReader(pekkoServerConfig)
85: 
86:   private lazy val initialSettings = ServerSettings(pekkoHttpConfig)
87: 
88:   private val httpIdleTimeout  = serverConfig.get[Duration]("http.idleTimeout")
89:   private val httpsIdleTimeout = serverConfig.get[Duration]("https.idleTimeout")
90:   private val requestTimeout   = pekkoServerConfig.get[Duration]("requestTimeout")
91:   private val bindTimeout      = pekkoServerConfig.get[FiniteDuration]("bindTimeout")
92:   private val terminationDelay = serverConfig.get[FiniteDuration]("waitBeforeTermination")
93:   private val terminationTimeout =
94:     serverConfig.getDeprecated[Option[FiniteDuration]]("terminationTimeout", "pekko.terminationTimeout")
95: 
96:   private val maxContentLength =
97:     Server.getPossiblyInfiniteBytes(serverConfig.underlying, "max-content-length", "pekko.max-content-length")
98:   private val maxHeaderValueLength =
99:     serverConfig.getDeprecated[ConfigMemorySize]("max-header-size", "pekko.max-header-value-length").toBytes.toInt
100:   private val includeTlsSessionInfoHeader = pekkoServerConfig.get[Boolean]("tls-session-info-header")
101:   private val defaultHostHeader           = pekkoServerConfigReader.getHostHeader.fold(throw _, identity)
102:   private val transparentHeadRequests     = pekkoServerConfig.get[Boolean]("transparent-head-requests")
103:   private val serverHeaderConfig          = pekkoServerConfig.getOptional[String]("server-header")
104:   private val pipeliningLimit             = pekkoServerConfig.get[Int]("pipelining-limit")
105:   private val serverHeader = serverHeaderConfig.collect {
106:     case s if s.nonEmpty => headers.Server(s)
107:   }
SOURCE https://github.com/playframework/playframework/blob/4564a5cf3a811399eccc4023d422c0413be09bf7/dev-mode/sbt-plugin/src/main/scala/play/sbt/PlaySettings.scala
SHA256 7b84954a6dacb2dfa2eab0d83d07f935ea432f8a572cc7cc2471318abaee5208
93:             |${Colors.red(Colors.bold("Play 2.8 has reached its end-of-life (EOL) as of May 31st, 2024 and no longer receives security updates!"))}
94:             |Please upgrade, see https://www.playframework.com/documentation/2.9.x/Highlights29
95:             |
96:             |
97:             |""".stripMargin +
98:         (if (javaVersion == "17")
99:            s"""Running Play on Java ${sys.props("java.specification.version")} is experimental. Tweaks are necessary:
100:               |https://github.com/playframework/playframework/releases/2.8.15
101:               |
102:               |""".stripMargin
103:          else if (javaVersion != "1.8" && javaVersion != "11")
104:            s"""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
105:               |  Java version is ${sys
106:                .props("java.specification.version")}. Play supports only 8, 11 and, experimentally, 17.
107:               |!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
108:               |
109:               |""".stripMargin
110:          else "")
111:     },
