SBT rpm:package-bin因配置未找到错误而失败

时间:2015-10-06 06:03:58

标签: scala sbt rpm sbt-native-packager

我正在尝试在Build.scala中集成rpmPlugin,但似乎无法识别rpm配置。以下是我的配置在Build.scala

中的外观
enablePlugins(RpmPlugin)
lazy val packageSettings =  Seq(
  packageName in Rpm := "noname",
  version in Rpm := "1.0.0",
  rpmRelease in Rpm := Some("1"),
  packageArchitecture in Rpm := "noArch",
  packageSummary := "zyx",
  packageDescription := "zyx",
  rpmVendor  := "zyx",
  rpmUrl := "zyx",
  rpmLicense := "zyx"
)

我在plugin.sbt中也有以下内容

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

以下是build.scala中的导入

import Keys._
import sbtassembly.AssemblyKeys._
import scoverage.ScoverageSbtPlugin.ScoverageKeys._
import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.SbtNativePackager.autoImport._
import com.typesafe.sbt.packager.rpm.RpmPlugin
import com.typesafe.sbt.packager.archetypes.JavaServerAppPackaging

当我运行rpm package命令时显示所有这些信息...我得到以下错误(这些错误的多个)

[info] Compiling 1 Scala source to /home/vikrant/project/target/scala-2.10/sbt-0.13/classes...
[error] /home/vikrant/project/Build.scala:46: not found: value rpmRelease
[error]     rpmRelease := Some("1"),
[error]     ^
[error] /home/vikrant/project/Build.scala:48: not found: value packageArchitecture
[error]     packageArchitecture in Rpm := "noArch",
[error]     ^
[error] /home/vikrant/project/Build.scala:54: not found: value rpmVendor
[error]     rpmVendor  := "zyx",
[error]     ^
[error] /home/vikrant/project/Build.scala:56: not found: value rpmUrl
[error]     rpmUrl := "zyx",
[error]     ^
[error] /home/vikrant/project/Build.scala:58: not found: value rpmLicense
[error]     rpmLicense := "zyx"
[error]     ^
[error] 5 errors found
[error] (compile:compileIncremental) Compilation failed

请告知我可以做些什么来摆脱这个错误。文档不是很有帮助,似乎是为Buid.sbt用法编写的。

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

看来这个功能对我们放置配置的顺序很严格。 当其他一切都失败时,我尝试使用配置顺序......然后继续工作。

version in Rpm := "1.0.0",
maintainer := "someValue",
packageArchitecture in Rpm := ""someValue"",
packageSummary in Rpm := ""someValue"",
packageDescription in Rpm := ""someValue"",
packageName in Linux := ""someValue"",
rpmRelease := "1",
rpmVendor := ""someValue"",
rpmLicense := Some(""someValue"")

可以肯定的是,修复它可能不是正确的方法......但它解除了我的阻力。打算向SBT提出一个问题。