Вопрос

i want to start my scala app as a background service on a ubuntu machine. I'm currently trying to figure out how to use the JavaServerAppPackaging Settings in my package task.

Any suggestion, what I have to add where to include the upstart script in my deb file?

This is my Project description incl. oneJar and debian building.

 lazy val root = Project(id = appName, base = file("."), settings = SbtOneJar.oneJarSettings ++ packageSettings ++ allSettings ++ Project.defaultSettings)

  lazy val allSettings = Seq(
    mainClass in SbtOneJar.oneJar := Some("Kernel"),
    resolvers += "Typesafe Releases" at "http://repo.typesafe.com/typesafe/releases",
    resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/",
    libraryDependencies ++= dependencies)

  lazy val packageSettings = JavaServerAppPackaging.settings ++ packagerSettings ++ Seq(
    version := appVersion,
    packageSummary := appName,
    packageDescription := appName,
    maintainer := appAuthor,
    mappings in Universal += {
      SbtOneJar.oneJar.value -> jarFsPath
    },
    linuxPackageMappings in Debian <+= (SbtOneJar.oneJar) map {
      jar: File =>
        (packageMapping(jar -> jarFsPath) withUser unixUser withGroup unixGroup withPerms "0755")
    },
    debianPackageDependencies in Debian ++= Seq("openjdk-7-jre-headless"))
}
Это было полезно?

Решение

The settings should include the packageArchetype.java_server value eg:

lazy val packageSettings = packageArchetype.java_server ++ Seq(
/* ... */ 
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top