5

我正在使用 sbt-native-packager 为我的 Scala Play 2 项目创建 Debian 包并将其发布到 Artifactory 存储库。

到目前为止,我能够生成.deb包,但无法将其发布到工件 URL。唯一发布的工件是 debian.changes文件,而不是实际.deb文件。

我最近升级到使用 sbt 0.13.5 和 sbt-native-packager 0.7.4 的 Play 2.3.2。这可能是相关的,因为将 .deb 文件发布到工件确实曾经与 sbt-native-packager 0.7.1 一起使用。

我已经努力理解这个问题,并且确实发现我必须将最新版本添加debianChangelog in Debian := Some(file("src/debian/changelog"))到我的.sbt文件中,但我现在被卡住了。

我的问题只是.deb当我这样做时没有文件被发布debian:publish。只有.changes文件被发布:
[info] published atk to http:...:8081/artifactory/atk-snapshots/atk/atk/1.0-SNAPSHOT/atk-1.0-SNAPSHOT.changes

有人知道我应该做什么来解决我的发布问题吗?

我在项目的 .sbt 文件中将以下设置作为导入和版本:

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.SbtNativePackager.NativePackagerKeys._
import com.typesafe.sbt.packager.archetypes.ServerLoader.SystemV
import NativePackagerKeys._

name := """atk"""

scalacOptions += "-target:jvm-1.7"

javacOptions ++= Seq("-source", "1.7", "-target", "1.7")

version := "1.1-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.1"

对于包装部分:

// Packaging info

debianChangelog in Debian := Some(file("src/debian/changelog"))

serverLoading in Debian := SystemV

packageDescription in Debian := "Parlis Elvis Adapter"

packageSummary in Debian := "Parlis Elvis Adapter"

maintainer in Debian := "Daan Hoogenboezem"

daemonUser in Linux := "ape"

daemonGroup in Linux := "ape"

sourceDirectory in Debian <<= (sourceDirectory) apply (_ / "debian")

mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) =>
    // we are using the reference.conf as default application.conf
    // the user can override settings here
    val conf = src / "linux" / "atk" / "startup.conf"
    conf -> "etc/atk/startup.conf"
}

linuxPackageMappings in Debian <+= (name in Universal, sourceDirectory in Debian) map { (name, dir) =>
  (packageMapping(
    (dir / "etc/changelog") -> "/usr/share/doc/atk/changelog.gz"
  ) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
}

defaultLinuxLogsLocation in Linux := "/var/log/atk"

deploymentSettings

// Publishing
publishTo := {
  val artifactory = "http://...:8081/artifactory/"
  if (version.value.trim.endsWith("SNAPSHOT"))
    Some("snapshots" at artifactory + "atk-snapshots")
  else
    Some("releases" at artifactory + "atk-releases")
}

publish in Debian <<= (publish in Debian).triggeredBy(publish in Compile)
4

1 回答 1

3

我的一位同事向我展示了修复程序,此处记录了该修复程序:http ://www.scala-sbt.org/sbt-native-packager/DetailedTopics/deployment.html?highlight=publish

简而言之,需要在 build.sbt 中添加以下语句:

makeDeploymentSettings(Debian, packageBin in Debian, "deb")
于 2015-01-07T15:38:27.317 回答