- sbt-pgp
- sbt-sonatype
- sbt-release
- Sonatype設定
- SBTのマニュアルに従って、SonatypeのプロジェクトJIRAにアカウントを作成する。
import scala.slick.driver.JdbcDriver.simple._ | |
val db = Database.forURL("jdbc:h2:mem:slicktest", driver = "org.h2.Driver") | |
implicit val session = db.createSession() | |
session.close() | |
db.withSession { implicit session => | |
// query | |
} |
lazy val project = Project ( | |
"app_name", | |
file(".") | |
).enablePlugins(PlayScala).settings( | |
// VersionとかlibraryDependenciesとか | |
) |
name := "app_name" | |
version := "1.0-SNAPSHOT" | |
libraryDependencies ++= Seq( | |
// libraryDependencies | |
) | |
play.Project.playScalaSettings |
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" | |
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.0") |
sbt.version=0.13.5 |
@echo off | |
SET CURRENT_DIR=%~dp0 | |
SET JAVA_OPTION=-Xms128m -Xmx512m -server -Dhttp.port=9000 | |
SET CLASS_PATH=%CURRENT_DIR%app\lib\* | |
SET ARGS=%CURRENT_DIR%app\ | |
java %JAVA_OPTION% -cp "%CLASS_PATH%" play.core.server.NettyServer %ARGS% |
Object Resource { | |
// 実行時例外 | |
val prop1 = new Properties | |
prop1.load(new FileInputStream("config.properties")) // -> FileNotFoundExceptionが投げられる | |
// target/scala-ver/classes/config.propertiesが読み込まれる | |
// (コンパイル前: src/main/resources/config.properties) | |
val prop2 = new Properties | |
prop2.load(this.getClass().getClassLoader().getResourceAsStream("config.properties")) // -> 読み込む |