2

我正在尝试使用 RPM 文件打包 Play Framework 应用程序,但我不知道将 Play Framework 项目中所需的配置放在哪里。

我已将插件添加到我的 project/plugins.sbt 文件中

// Comment to get more information during initialization
logLevel := Level.Warn

// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

resolvers += "tomax repository" at "http://maven.tmx.com/nexus"

// Use the Play sbt plugin for Play projects
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.3")

当我运行以下命令时,我在 Play 中遇到错误:

rpm:package-bin

然后我按照建议运行错误的最后一个命令,我得到了

Creating SPEC file: /projects/myproj/target/rpm/SPECS/MyProj.spec
[debug] Executing rpmbuild with: rpmbuild -bb --buildroot /projects/myproj/target/rpm/buildroot --define _topdir /projects/myproj/target/rpm --target noarch--Linux MyProj.spec
[error] error: line 4: Empty tag: Summary:
[info] Building target platforms: noarch--Linux
[info] Building for target noarch--Linux
java.lang.RuntimeException: Unable to run rpmbuild, check output for details
4

1 回答 1

4

使 sbt-native-packager 与 play 一起工作的一种方法是将以下内容添加到 Build.scala 中的设置中

val storeOpsServer = play.Project(
    "storeops-server", appVersion, appDependencies, path = file("storeops-server")
  ).settings(
    //Packaging for RPMs
    name in Rpm := "my-server",
    version in Rpm := appVersion,
    rpmRelease := "0",
    packageSummary := "Some summary of your software",
    rpmVendor := "My Corporation",
    rpmUrl := Some("http://www.mycorp.com"),
    rpmLicense := Some("MIT"),
    packageDescription := "Some description of what your server does",
    rpmGroup := Some("Group")
  ).dependsOn(adapterApi)

您不需要上述所有值,但这些是我使用并成功使用的值。

这是文件中的导入

import com.typesafe.sbt.packager.linux.{LinuxPackageMapping, LinuxSymlink}
import com.typesafe.sbt.packager.rpm.RpmDependencies
import com.typesafe.sbteclipse.core._
import sbt._
import Keys._
import play.Project._

import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.SbtNativePackager._
于 2013-11-13T23:45:29.490 回答