├── public ├── stylesheets │ └── main.css ├── javascripts │ └── hello.js └── images │ └── favicon.png ├── project ├── build.properties ├── plugins.sbt └── Build.scala ├── README.md ├── scripts └── test-sbt ├── modules ├── flyway │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── db │ │ │ └── migration │ │ │ ├── V20150409112518__create_users_table.sql │ │ │ └── V20150409131208__add_user.sql │ └── build.sbt ├── api │ └── src │ │ └── main │ │ └── scala │ │ └── com │ │ └── example │ │ └── user │ │ └── UserDAO.scala └── slick │ ├── src │ └── main │ │ ├── resources │ │ └── application.conf │ │ └── scala │ │ └── com │ │ └── example │ │ └── user │ │ └── slick │ │ └── SlickUserDAO.scala │ └── build.sbt ├── conf ├── routes └── logback.xml ├── NOTICE ├── app ├── views │ ├── main.scala.html │ └── index.scala.html ├── controllers │ └── HomeController.scala └── Module.scala ├── .gitignore ├── test └── controller │ ├── FunctionalSpec.scala │ └── MyApplicationFactory.scala ├── .mergify.yml ├── .travis.yml ├── .github └── settings.yml └── LICENSE /public/stylesheets/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.2.8 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MOVED TO https://github.com/playframework/play-samples 2 | -------------------------------------------------------------------------------- /public/javascripts/hello.js: -------------------------------------------------------------------------------- 1 | if (window.console) { 2 | console.log("Welcome to your Play application's JavaScript!"); 3 | } -------------------------------------------------------------------------------- /public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playframework/play-scala-isolated-slick-example/2.7.x/public/images/favicon.png -------------------------------------------------------------------------------- /scripts/test-sbt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "+----------------------------+" 4 | echo "| Executing tests using sbt |" 5 | echo "+----------------------------+" 6 | sbt ++$TRAVIS_SCALA_VERSION clean flyway/flywayMigrate slickCodegen test 7 | -------------------------------------------------------------------------------- /modules/flyway/src/main/resources/db/migration/V20150409112518__create_users_table.sql: -------------------------------------------------------------------------------- 1 | create table "users" ( 2 | "id" VARCHAR(255) PRIMARY KEY NOT NULL, 3 | "email" VARCHAR(1024) NOT NULL, 4 | created_at TIMESTAMP NOT NULL, 5 | updated_at TIMESTAMP NULL 6 | ); 7 | -------------------------------------------------------------------------------- /modules/flyway/src/main/resources/db/migration/V20150409131208__add_user.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO "users" VALUES ( 2 | 'd074bce8-a8ca-49ec-9225-a50ffe83dc2f', 3 | 'myuser@example.com', 4 | (TIMESTAMP '2013-03-26T17:50:06Z'), 5 | (TIMESTAMP '2013-03-26T17:50:06Z') 6 | ); 7 | -------------------------------------------------------------------------------- /conf/routes: -------------------------------------------------------------------------------- 1 | # Routes 2 | # This file defines all application routes (Higher priority routes first) 3 | # ~~~~ 4 | 5 | # Home page 6 | GET / controllers.HomeController.index 7 | 8 | # Map static resources from the /public folder to the /assets URL path 9 | GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) 10 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Written by Lightbend 2 | 3 | To the extent possible under law, the author(s) have dedicated all copyright and 4 | related and neighboring rights to this software to the public domain worldwide. 5 | This software is distributed without any warranty. 6 | 7 | You should have received a copy of the CC0 Public Domain Dedication along with 8 | this software. If not, see . 9 | -------------------------------------------------------------------------------- /app/views/main.scala.html: -------------------------------------------------------------------------------- 1 | @(title: String)(content: Html) 2 | 3 | 4 | 5 | 6 | 7 | @title 8 | 9 | 10 | 11 | 12 | 13 | @content 14 | 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | 3 | modules/play/logs/ 4 | 5 | # sbt specific 6 | .cache 7 | .history 8 | .lib/ 9 | dist/* 10 | target/ 11 | lib_managed/ 12 | src_managed/ 13 | project/boot/ 14 | project/plugins/project/ 15 | 16 | # Scala-IDE specific 17 | .scala_dependencies 18 | .worksheet 19 | 20 | ### PlayFramework template 21 | # Ignore Play! working directory # 22 | bin/ 23 | /db 24 | .eclipse 25 | /lib/ 26 | /logs/ 27 | /project/project 28 | /project/target 29 | /target 30 | tmp/ 31 | test-result 32 | server.pid 33 | *.iml 34 | *.eml 35 | /dist/ 36 | 37 | 38 | test.mv.db 39 | -------------------------------------------------------------------------------- /app/views/index.scala.html: -------------------------------------------------------------------------------- 1 | @(users: Seq[User]) 2 | 3 | @main("Title Page") { 4 |

Users

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | @for(user <- users){ 14 | 15 | 16 | 17 | 18 | 19 | 20 | } 21 |
IdEmailCreated AtUpdated At
@user.id@user.email@user.createdAt@user.updatedAt
22 | } 23 | -------------------------------------------------------------------------------- /app/controllers/HomeController.scala: -------------------------------------------------------------------------------- 1 | package controllers 2 | 3 | import javax.inject.{Inject, Singleton} 4 | 5 | import com.example.user.UserDAO 6 | import play.api.mvc._ 7 | 8 | import scala.concurrent.ExecutionContext 9 | 10 | @Singleton 11 | class HomeController @Inject() (userDAO: UserDAO, cc: ControllerComponents) 12 | (implicit ec: ExecutionContext) 13 | extends AbstractController(cc) { 14 | 15 | def index = Action.async { implicit request => 16 | userDAO.all.map { users => 17 | Ok(views.html.index(users)) 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /test/controller/FunctionalSpec.scala: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import org.scalatestplus.play.{BaseOneAppPerSuite, PlaySpec} 4 | import play.api.test.FakeRequest 5 | import play.api.test.Helpers._ 6 | 7 | /** 8 | * Runs a functional test with the application, using an in memory 9 | * database. Migrations are handled automatically by play-flyway 10 | */ 11 | class FunctionalSpec extends PlaySpec with BaseOneAppPerSuite with MyApplicationFactory { 12 | 13 | "HomeController" should { 14 | 15 | "work with in memory h2 database" in { 16 | val future = route(app, FakeRequest(GET, "/")).get 17 | contentAsString(future) must include("myuser@example.com") 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /modules/flyway/build.sbt: -------------------------------------------------------------------------------- 1 | // Database Migrations: 2 | // run with "sbt flywayMigrate" 3 | // http://flywaydb.org/getstarted/firststeps/sbt.html 4 | 5 | //$ export DB_DEFAULT_URL="jdbc:h2:/tmp/example.db" 6 | //$ export DB_DEFAULT_USER="sa" 7 | //$ export DB_DEFAULT_PASSWORD="" 8 | 9 | libraryDependencies += "org.flywaydb" % "flyway-core" % "5.0.3" 10 | 11 | lazy val databaseUrl = sys.env.getOrElse("DB_DEFAULT_URL", "jdbc:h2:./test") 12 | lazy val databaseUser = sys.env.getOrElse("DB_DEFAULT_USER", "sa") 13 | lazy val databasePassword = sys.env.getOrElse("DB_DEFAULT_PASSWORD", "") 14 | 15 | flywayLocations := Seq("classpath:db/migration") 16 | 17 | flywayUrl := databaseUrl 18 | flywayUser := databaseUser 19 | flywayPassword := databasePassword 20 | -------------------------------------------------------------------------------- /modules/api/src/main/scala/com/example/user/UserDAO.scala: -------------------------------------------------------------------------------- 1 | package com.example.user 2 | 3 | import org.joda.time.DateTime 4 | 5 | import scala.concurrent.Future 6 | 7 | /** 8 | * An implementation dependent DAO. This could be implemented by Slick, Cassandra, or a REST API. 9 | */ 10 | trait UserDAO { 11 | 12 | def lookup(id: String): Future[Option[User]] 13 | 14 | def all: Future[Seq[User]] 15 | 16 | def update(user: User): Future[Int] 17 | 18 | def delete(id: String): Future[Int] 19 | 20 | def create(user: User): Future[Int] 21 | 22 | def close(): Future[Unit] 23 | } 24 | 25 | /** 26 | * Implementation independent aggregate root. 27 | */ 28 | case class User(id: String, email: String, createdAt: DateTime, updatedAt: Option[DateTime]) 29 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/" 2 | 3 | resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots" 4 | 5 | resolvers += "Flyway" at "https://flywaydb.org/repo" 6 | 7 | resolvers += "Flyway" at "https://davidmweber.github.io/flyway-sbt.repo" 8 | 9 | // Database migration 10 | addSbtPlugin("org.flywaydb" % "flyway-sbt" % "4.2.0") 11 | 12 | // Slick code generation 13 | // https://github.com/tototoshi/sbt-slick-codegen 14 | addSbtPlugin("com.github.tototoshi" % "sbt-slick-codegen" % "1.3.0") 15 | 16 | libraryDependencies += "com.h2database" % "h2" % "1.4.196" 17 | 18 | // The Play plugin 19 | addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.0") 20 | -------------------------------------------------------------------------------- /modules/slick/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | 2 | myapp = { 3 | database = { 4 | driver = org.h2.Driver 5 | url = "jdbc:h2:./test" 6 | user = "sa" 7 | password = "" 8 | 9 | // The number of threads determines how many things you can *run* in parallel 10 | // the number of connections determines you many things you can *keep in memory* at the same time 11 | // on the database server. 12 | // numThreads = (core_count (hyperthreading included)) 13 | numThreads = 4 14 | 15 | // queueSize = ((core_count * 2) + effective_spindle_count) 16 | // on a MBP 13, this is 2 cores * 2 (hyperthreading not included) + 1 hard disk 17 | queueSize = 5 18 | 19 | // https://blog.knoldus.com/2016/01/01/best-practices-for-using-slick-on-production/ 20 | // make larger than numThreads + queueSize 21 | maxConnections = 10 22 | 23 | connectionTimeout = 5000 24 | validationTimeout = 5000 25 | } 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /project/Build.scala: -------------------------------------------------------------------------------- 1 | import sbt.Keys._ 2 | import sbt.{Resolver, _} 3 | 4 | object Common { 5 | 6 | def projectSettings = Seq( 7 | scalaVersion := "2.12.6", 8 | javacOptions ++= Seq("-source", "1.8", "-target", "1.8"), 9 | scalacOptions ++= Seq( 10 | "-encoding", "UTF-8", // yes, this is 2 args 11 | "-deprecation", 12 | "-feature", 13 | "-unchecked", 14 | "-Xlint", 15 | "-Yno-adapted-args", 16 | "-Ywarn-numeric-widen" 17 | ), 18 | resolvers ++= Seq( 19 | "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases", 20 | Resolver.sonatypeRepo("releases"), 21 | Resolver.sonatypeRepo("snapshots")), 22 | libraryDependencies ++= Seq( 23 | "javax.inject" % "javax.inject" % "1", 24 | "joda-time" % "joda-time" % "2.9.9", 25 | "org.joda" % "joda-convert" % "1.9.2", 26 | "com.google.inject" % "guice" % "4.1.0" 27 | ), 28 | scalacOptions in Test ++= Seq("-Yrangepos") 29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: Merge PRs that are ready 3 | conditions: 4 | - status-success=Travis CI - Pull Request 5 | - status-success=typesafe-cla-validator 6 | - "#approved-reviews-by>=1" 7 | - "#review-requested=0" 8 | - "#changes-requested-reviews-by=0" 9 | - label!=status:block-merge 10 | actions: 11 | merge: 12 | method: squash 13 | strict: smart 14 | 15 | - name: Merge TemplateControl's PRs that are ready 16 | conditions: 17 | - status-success=Travis CI - Pull Request 18 | - "#review-requested=0" 19 | - "#changes-requested-reviews-by=0" 20 | - label!=status:block-merge 21 | - label=status:merge-when-green 22 | - label!=status:block-merge 23 | actions: 24 | merge: 25 | method: squash 26 | strict: smart 27 | 28 | - name: Delete the PR branch after merge 29 | conditions: 30 | - merged 31 | actions: 32 | delete_head_branch: {} 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: scala 2 | scala: 2.12.8 3 | script: $SCRIPT 4 | 5 | env: 6 | matrix: 7 | - SCRIPT=scripts/test-sbt TRAVIS_JDK=adopt@1.8.202-08 8 | - SCRIPT=scripts/test-sbt TRAVIS_JDK=adopt@1.11.0-2 9 | - SCRIPT=scripts/test-gradle TRAVIS_JDK=adopt@1.8.202-08 10 | - SCRIPT=scripts/test-gradle TRAVIS_JDK=adopt@1.11.0-2 11 | 12 | matrix: 13 | fast_finish: true 14 | allow_failures: 15 | - env: SCRIPT=scripts/test-gradle TRAVIS_JDK=adopt@1.8.202-08 # current gradle doesn't support play 2.7 16 | - env: SCRIPT=scripts/test-gradle TRAVIS_JDK=adopt@1.11.0-2 # current gradle doesn't support play 2.7 17 | - env: SCRIPT=scripts/test-sbt TRAVIS_JDK=adopt@1.11.0-2 # not fully supported but allows problem discovery 18 | 19 | before_install: curl -Ls https://git.io/jabba | bash && . ~/.jabba/jabba.sh 20 | install: jabba install "$TRAVIS_JDK" && jabba use "$_" && java -Xmx32m -version 21 | 22 | cache: 23 | directories: 24 | - "$HOME/.gradle/caches" 25 | - "$HOME/.ivy2/cache" 26 | - "$HOME/.jabba/jdk" 27 | - "$HOME/.sbt" 28 | 29 | before_cache: 30 | - find $HOME/.ivy2 -name "ivydata-*.properties" -delete 31 | - find $HOME/.sbt -name "*.lock" -delete 32 | -------------------------------------------------------------------------------- /app/Module.scala: -------------------------------------------------------------------------------- 1 | import javax.inject.{Inject, Provider, Singleton} 2 | 3 | import com.example.user.UserDAO 4 | import com.example.user.slick.SlickUserDAO 5 | import com.google.inject.AbstractModule 6 | import com.typesafe.config.Config 7 | import play.api.inject.ApplicationLifecycle 8 | import play.api.{Configuration, Environment} 9 | import slick.jdbc.JdbcBackend.Database 10 | 11 | import scala.concurrent.Future 12 | 13 | /** 14 | * This module handles the bindings for the API to the Slick implementation. 15 | * 16 | * https://www.playframework.com/documentation/latest/ScalaDependencyInjection#Programmatic-bindings 17 | */ 18 | class Module(environment: Environment, 19 | configuration: Configuration) extends AbstractModule { 20 | override def configure(): Unit = { 21 | bind(classOf[Database]).toProvider(classOf[DatabaseProvider]) 22 | bind(classOf[UserDAO]).to(classOf[SlickUserDAO]) 23 | bind(classOf[UserDAOCloseHook]).asEagerSingleton() 24 | } 25 | } 26 | 27 | @Singleton 28 | class DatabaseProvider @Inject() (config: Config) extends Provider[Database] { 29 | lazy val get = Database.forConfig("myapp.database", config) 30 | } 31 | 32 | /** Closes database connections safely. Important on dev restart. */ 33 | class UserDAOCloseHook @Inject()(dao: UserDAO, lifecycle: ApplicationLifecycle) { 34 | lifecycle.addStopHook { () => 35 | Future.successful(dao.close()) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /conf/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ${application.home:-.}/logs/application.log 7 | 8 | %date [%level] from %logger in %thread - %message%n%xException 9 | 10 | 11 | 12 | 13 | 14 | %coloredLevel %logger{15} - %message%n%xException{10} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /modules/slick/build.sbt: -------------------------------------------------------------------------------- 1 | import slick.codegen.SourceCodeGenerator 2 | import slick.{ model => m } 3 | 4 | libraryDependencies ++= Seq( 5 | "com.zaxxer" % "HikariCP" % "2.7.9", 6 | "com.typesafe.slick" %% "slick" % "3.2.3", 7 | "com.typesafe.slick" %% "slick-hikaricp" % "3.2.3", 8 | "com.github.tototoshi" %% "slick-joda-mapper" % "2.3.0" 9 | ) 10 | 11 | lazy val databaseUrl = sys.env.getOrElse("DB_DEFAULT_URL", "jdbc:h2:./test") 12 | lazy val databaseUser = sys.env.getOrElse("DB_DEFAULT_USER", "sa") 13 | lazy val databasePassword = sys.env.getOrElse("DB_DEFAULT_PASSWORD", "") 14 | 15 | slickCodegenSettings 16 | slickCodegenDatabaseUrl := databaseUrl 17 | slickCodegenDatabaseUser := databaseUser 18 | slickCodegenDatabasePassword := databasePassword 19 | slickCodegenDriver := slick.driver.H2Driver 20 | slickCodegenJdbcDriver := "org.h2.Driver" 21 | slickCodegenOutputPackage := "com.example.user.slick" 22 | slickCodegenExcludedTables := Seq("schema_version") 23 | 24 | slickCodegenCodeGenerator := { (model: m.Model) => 25 | new SourceCodeGenerator(model) { 26 | override def code = 27 | "import com.github.tototoshi.slick.H2JodaSupport._\n" + "import org.joda.time.DateTime\n" + super.code 28 | override def Table = new Table(_) { 29 | override def Column = new Column(_) { 30 | override def rawType = model.tpe match { 31 | case "java.sql.Timestamp" => "DateTime" // kill j.s.Timestamp 32 | case _ => 33 | super.rawType 34 | } 35 | } 36 | } 37 | } 38 | } 39 | 40 | sourceGenerators in Compile += slickCodegen.taskValue 41 | -------------------------------------------------------------------------------- /test/controller/MyApplicationFactory.scala: -------------------------------------------------------------------------------- 1 | package controller 2 | 3 | import java.util.Properties 4 | 5 | import com.google.inject.Inject 6 | import org.flywaydb.core.Flyway 7 | import org.flywaydb.core.internal.util.jdbc.DriverDataSource 8 | import org.scalatestplus.play.FakeApplicationFactory 9 | import play.api.inject.guice.GuiceApplicationBuilder 10 | import play.api.inject.{Binding, Module} 11 | import play.api.{Application, Configuration, Environment} 12 | 13 | /** 14 | * Set up an application factory that runs flyways migrations on in memory database. 15 | */ 16 | trait MyApplicationFactory extends FakeApplicationFactory { 17 | def fakeApplication(): Application = { 18 | new GuiceApplicationBuilder() 19 | .configure(Map("myapp.database.url" -> "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1")) 20 | .bindings(new FlywayModule) 21 | .build() 22 | } 23 | } 24 | 25 | class FlywayModule extends Module { 26 | override def bindings(environment: Environment, configuration: Configuration): Seq[Binding[_]] = { 27 | Seq(bind[FlywayMigrator].toSelf.eagerly() ) 28 | } 29 | } 30 | 31 | class FlywayMigrator @Inject()(env: Environment, configuration: Configuration) { 32 | def onStart(): Unit = { 33 | val driver = configuration.get[String]("myapp.database.driver") 34 | val url = configuration.get[String]("myapp.database.url") 35 | val user = configuration.get[String]("myapp.database.user") 36 | val password = configuration.get[String]("myapp.database.password") 37 | val flyway = new Flyway 38 | flyway.setDataSource(new DriverDataSource(env.classLoader, driver, url, user, password, new Properties())) 39 | flyway.setLocations("filesystem:modules/flyway/src/main/resources/db/migration") 40 | flyway.migrate() 41 | } 42 | 43 | onStart() 44 | } 45 | -------------------------------------------------------------------------------- /modules/slick/src/main/scala/com/example/user/slick/SlickUserDAO.scala: -------------------------------------------------------------------------------- 1 | package com.example.user.slick 2 | 3 | import javax.inject.{Inject, Singleton} 4 | 5 | import org.joda.time.DateTime 6 | import slick.jdbc.JdbcProfile 7 | import slick.jdbc.JdbcBackend.Database 8 | import com.example.user._ 9 | 10 | import scala.concurrent.{ExecutionContext, Future} 11 | import scala.language.implicitConversions 12 | 13 | /** 14 | * A User DAO implemented with Slick, leveraging Slick code gen. 15 | * 16 | * Note that you must run "flyway/flywayMigrate" before "compile" here. 17 | * 18 | * @param db the slick database that this user DAO is using internally, bound through Module. 19 | * @param ec a CPU bound execution context. Slick manages blocking JDBC calls with its 20 | * own internal thread pool, so Play's default execution context is fine here. 21 | */ 22 | @Singleton 23 | class SlickUserDAO @Inject()(db: Database)(implicit ec: ExecutionContext) extends UserDAO with Tables { 24 | 25 | override val profile: JdbcProfile = _root_.slick.jdbc.H2Profile 26 | 27 | import profile.api._ 28 | 29 | private val queryById = Compiled( 30 | (id: Rep[String]) => Users.filter(_.id === id)) 31 | 32 | def lookup(id: String): Future[Option[User]] = { 33 | val f: Future[Option[UsersRow]] = db.run(queryById(id).result.headOption) 34 | f.map(maybeRow => maybeRow.map(usersRowToUser)) 35 | } 36 | 37 | def all: Future[Seq[User]] = { 38 | val f = db.run(Users.result) 39 | f.map(seq => seq.map(usersRowToUser)) 40 | } 41 | 42 | def update(user: User): Future[Int] = { 43 | db.run(queryById(user.id).update(userToUsersRow(user))) 44 | } 45 | 46 | def delete(id: String): Future[Int] = { 47 | db.run(queryById(id).delete) 48 | } 49 | 50 | def create(user: User): Future[Int] = { 51 | db.run( 52 | Users += userToUsersRow(user.copy(createdAt = DateTime.now())) 53 | ) 54 | } 55 | 56 | def close(): Future[Unit] = { 57 | Future.successful(db.close()) 58 | } 59 | 60 | private def userToUsersRow(user: User): UsersRow = { 61 | UsersRow(user.id, user.email, user.createdAt, user.updatedAt) 62 | } 63 | 64 | private def usersRowToUser(usersRow: UsersRow): User = { 65 | User(usersRow.id, usersRow.email, usersRow.createdAt, usersRow.updatedAt) 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # These settings are synced to GitHub by https://probot.github.io/apps/settings/ 2 | repository: 3 | homepage: "https://developer.lightbend.com/start/?group=play" 4 | topics: playframework, example, example-project, sample, sample-app, jvm, webapp 5 | private: false 6 | has_issues: true 7 | # We don't need projects in sample projects 8 | has_projects: false 9 | # We don't need wiki in sample projects 10 | has_wiki: false 11 | has_downloads: true 12 | default_branch: 2.7.x 13 | allow_squash_merge: true 14 | allow_merge_commit: false 15 | allow_rebase_merge: false 16 | 17 | teams: 18 | - name: core 19 | permission: admin 20 | - name: integrators 21 | permission: write 22 | - name: write-bots 23 | permission: write 24 | 25 | branches: 26 | - name: "[0-9].*.x" 27 | protection: 28 | # We don't require reviews for sample applications because they are mainly 29 | # updated by template-control, which is an automated process 30 | required_pull_request_reviews: null 31 | # Required. Require status checks to pass before merging. Set to null to disable 32 | required_status_checks: 33 | # Required. The list of status checks to require in order to merge into this branch 34 | contexts: ["Travis CI - Pull Request", "typesafe-cla-validator"] 35 | 36 | # Labels: tailored list of labels to be used by sample applications 37 | labels: 38 | - color: f9d0c4 39 | name: "closed:declined" 40 | - color: f9d0c4 41 | name: "closed:duplicated" 42 | oldname: duplicate 43 | - color: f9d0c4 44 | name: "closed:invalid" 45 | oldname: invalid 46 | - color: f9d0c4 47 | name: "closed:question" 48 | oldname: question 49 | - color: f9d0c4 50 | name: "closed:wontfix" 51 | oldname: wontfix 52 | - color: 7057ff 53 | name: "good first issue" 54 | - color: 7057ff 55 | name: "Hacktoberfest" 56 | - color: 7057ff 57 | name: "help wanted" 58 | - color: cceecc 59 | name: "status:backlog" 60 | oldname: backlog 61 | - color: b60205 62 | name: "status:block-merge" 63 | oldname: block-merge 64 | - color: b60205 65 | name: "status:blocked" 66 | - color: 0e8a16 67 | name: "status:in-progress" 68 | - color: 0e8a16 69 | name: "status:merge-when-green" 70 | oldname: merge-when-green 71 | - color: fbca04 72 | name: "status:needs-backport" 73 | - color: fbca04 74 | name: "status:needs-forwardport" 75 | - color: fbca04 76 | name: "status:needs-info" 77 | - color: fbca04 78 | name: "status:needs-verification" 79 | - color: 0e8a16 80 | name: "status:ready" 81 | - color: fbca04 82 | name: "status:to-review" 83 | oldname: review 84 | - color: c5def5 85 | name: "topic:build/tests" 86 | - color: c5def5 87 | name: "topic:dev-environment" 88 | - color: c5def5 89 | name: "topic:documentation" 90 | - color: c5def5 91 | name: "topic:jdk-next" 92 | - color: b60205 93 | name: "type:defect" 94 | oldname: bug 95 | - color: 0052cc 96 | name: "type:feature" 97 | - color: 0052cc 98 | name: "type:improvement" 99 | oldname: enhancement 100 | - color: 0052cc 101 | name: "type:updates" 102 | - color: bf0d92 103 | name: "type:template-control" 104 | oldname: template-control 105 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer 6 | exclusive Copyright and Related Rights (defined below) upon the creator and 7 | subsequent owner(s) (each and all, an "owner") of an original work of 8 | authorship and/or a database (each, a "Work"). 9 | 10 | Certain owners wish to permanently relinquish those rights to a Work for the 11 | purpose of contributing to a commons of creative, cultural and scientific 12 | works ("Commons") that the public can reliably and without fear of later 13 | claims of infringement build upon, modify, incorporate in other works, reuse 14 | and redistribute as freely as possible in any form whatsoever and for any 15 | purposes, including without limitation commercial purposes. These owners may 16 | contribute to the Commons to promote the ideal of a free culture and the 17 | further production of creative, cultural and scientific works, or to gain 18 | reputation or greater distribution for their Work in part through the use and 19 | efforts of others. 20 | 21 | For these and/or other purposes and motivations, and without any expectation 22 | of additional consideration or compensation, the person associating CC0 with a 23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright 24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work 25 | and publicly distribute the Work under its terms, with knowledge of his or her 26 | Copyright and Related Rights in the Work and the meaning and intended legal 27 | effect of CC0 on those rights. 28 | 29 | 1. Copyright and Related Rights. A Work made available under CC0 may be 30 | protected by copyright and related or neighboring rights ("Copyright and 31 | Related Rights"). Copyright and Related Rights include, but are not limited 32 | to, the following: 33 | 34 | i. the right to reproduce, adapt, distribute, perform, display, communicate, 35 | and translate a Work; 36 | 37 | ii. moral rights retained by the original author(s) and/or performer(s); 38 | 39 | iii. publicity and privacy rights pertaining to a person's image or likeness 40 | depicted in a Work; 41 | 42 | iv. rights protecting against unfair competition in regards to a Work, 43 | subject to the limitations in paragraph 4(a), below; 44 | 45 | v. rights protecting the extraction, dissemination, use and reuse of data in 46 | a Work; 47 | 48 | vi. database rights (such as those arising under Directive 96/9/EC of the 49 | European Parliament and of the Council of 11 March 1996 on the legal 50 | protection of databases, and under any national implementation thereof, 51 | including any amended or successor version of such directive); and 52 | 53 | vii. other similar, equivalent or corresponding rights throughout the world 54 | based on applicable law or treaty, and any national implementations thereof. 55 | 56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of, 57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and 58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright 59 | and Related Rights and associated claims and causes of action, whether now 60 | known or unknown (including existing as well as future claims and causes of 61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum 62 | duration provided by applicable law or treaty (including future time 63 | extensions), (iii) in any current or future medium and for any number of 64 | copies, and (iv) for any purpose whatsoever, including without limitation 65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes 66 | the Waiver for the benefit of each member of the public at large and to the 67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver 68 | shall not be subject to revocation, rescission, cancellation, termination, or 69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work 70 | by the public as contemplated by Affirmer's express Statement of Purpose. 71 | 72 | 3. Public License Fallback. Should any part of the Waiver for any reason be 73 | judged legally invalid or ineffective under applicable law, then the Waiver 74 | shall be preserved to the maximum extent permitted taking into account 75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver 76 | is so judged Affirmer hereby grants to each affected person a royalty-free, 77 | non transferable, non sublicensable, non exclusive, irrevocable and 78 | unconditional license to exercise Affirmer's Copyright and Related Rights in 79 | the Work (i) in all territories worldwide, (ii) for the maximum duration 80 | provided by applicable law or treaty (including future time extensions), (iii) 81 | in any current or future medium and for any number of copies, and (iv) for any 82 | purpose whatsoever, including without limitation commercial, advertising or 83 | promotional purposes (the "License"). The License shall be deemed effective as 84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the 85 | License for any reason be judged legally invalid or ineffective under 86 | applicable law, such partial invalidity or ineffectiveness shall not 87 | invalidate the remainder of the License, and in such case Affirmer hereby 88 | affirms that he or she will not (i) exercise any of his or her remaining 89 | Copyright and Related Rights in the Work or (ii) assert any associated claims 90 | and causes of action with respect to the Work, in either case contrary to 91 | Affirmer's express Statement of Purpose. 92 | 93 | 4. Limitations and Disclaimers. 94 | 95 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 96 | surrendered, licensed or otherwise affected by this document. 97 | 98 | b. Affirmer offers the Work as-is and makes no representations or warranties 99 | of any kind concerning the Work, express, implied, statutory or otherwise, 100 | including without limitation warranties of title, merchantability, fitness 101 | for a particular purpose, non infringement, or the absence of latent or 102 | other defects, accuracy, or the present or absence of errors, whether or not 103 | discoverable, all to the greatest extent permissible under applicable law. 104 | 105 | c. Affirmer disclaims responsibility for clearing rights of other persons 106 | that may apply to the Work or any use thereof, including without limitation 107 | any person's Copyright and Related Rights in the Work. Further, Affirmer 108 | disclaims responsibility for obtaining any necessary consents, permissions 109 | or other rights required for any use of the Work. 110 | 111 | d. Affirmer understands and acknowledges that Creative Commons is not a 112 | party to this document and has no duty or obligation with respect to this 113 | CC0 or use of the Work. 114 | 115 | For more information, please see 116 | 117 | --------------------------------------------------------------------------------