我正在尝试使用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
答案 0 :(得分: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._