Playframework(14)Publish the Dist Binary

Playframework(14)Publish the Dist Binary

Here is the project/Build.scala
import sbt._
import sbt.Keys._
import PlayProject._

object ApplicationBuild extends Build {

    val appName         = “projectName"
    val appVersion      = "1.0-SNAPSHOT"

  lazy val distSettings = Seq[Setting[_]] (
    // Type of the Artifact : zip
    // Extension of the Artifact : zip
    artifact in dist <<= moduleName(n => Artifact(n, "zip", "zip"))
  ) ++ Seq(addArtifact(artifact in (Compile, dist), dist).settings: _*)

    val appDependencies = Seq(
      // Add your project dependencies here,
      "mysql" % "mysql-connector-java" % "5.1.13",
      "net.sf.jasperreports" % "jasperreports" % "5.1.0",
      "org.apache.poi" % "poi" % "3.9",
      "commons-logging" % "commons-logging" % "1.1.2",
      "commons-digester" % "commons-digester" % "2.1",
      "commons-collections" % "commons-collections" % "3.2.1",
      "org.springframework" % "spring-core" % "3.2.2.RELEASE",
      "org.springframework" % "spring-beans" % "3.2.2.RELEASE",
      "com.lowagie" % "itext" % "4.2.0",
      "org.codehaus.groovy" % "groovy-all" % "2.1.3",
      "org.scalaquery" % "scalaquery_2.9.0-1" % "0.9.5",
      "c3p0" % "c3p0" % "0.9.1.2",
      "mysql" % "mysql-connector-java" % "5.1.25",
      "org.scalatest" %% "scalatest" % "1.8" % "test"
    )

    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA
        ,settings = Defaults.defaultSettings ++ distSettings
      ).settings(
      // Add your own project settings here
      testOptions in Test := Nil,

        // Optional
        // Disable jar for this project (useless)
        //publishArtifact in (Compile, packageBin) := false,

        // Disable scaladoc generation for this project (useless)
        //publishArtifact in (Compile, packageDoc) := false,

        // Disable source jar for this project (useless)
        //publishArtifact in (Compile, packageSrc) := false,

      resolvers += “sillycat repo" at "http://repository.sillycat.com/artifactory/sillycat-dev",
      credentials += Credentials("Artifactory Realm", "repository.sillycat.com", “sillycat", “password"),
      publishTo := Some(“Sillycat Artifactory Dev" at "http://repository.sillycat.com/artifactory/sillycat-dev/")
    )

}

The command will publish the zip and the jar
>sbt clean update compile package dist publish




References:
http://blog.dlecan.com/how-to-publish-play-framework-v2-dist-package/



猜你喜欢

转载自sillycat.iteye.com/blog/2108886