Search code examples
scalasbtsbt-native-packager

Why does debian:package-bin throw "packageDescription in Debian cannot be empty" when build.sbt has the setting?


I want to create an Debian package with my code written in Scala with sbt and sbt-native-package.

But when I try to execute debian:package-bin in sbt console, I receive this error:

[trace] Stack trace suppressed: run last debian:debianControlFile for the full output.
[error] (debian:debianControlFile) packageDescription in Debian cannot be empty. Use
[error]                  packageDescription in Debian := "My package Description"

This is strange, because in my build.sbt I have the packageDescription setting as follows:

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.packager.Keys._
import NativePackagerKeys._
import com.typesafe.sbt.packager.archetypes.ServerLoader.{SystemV, Upstart}

serverLoading in Debian := SystemV

name := "testApp"

version := "1.0"

organization := "com.testApp"

scalaVersion := "2.10.3"

maintainer in Debian := "gdc <aaa@aaa.com>"

packageSummary in Debian := "testApp"

packageDescription in Debian := "testApp"

packageArchetype.java_server

exportJars := true

I did tests using packageDescription := "testApp" or packageDescription in Linux := "testApp" but neither worked.


Solution

  • Move the line

    packageArchetype.java_server
    

    to be just after the imports, so it will not override the settings.

    build.sbt

    import com.typesafe.sbt.SbtNativePackager._
    import com.typesafe.sbt.packager.Keys._
    import NativePackagerKeys._
    import com.typesafe.sbt.packager.archetypes.ServerLoader.{SystemV, Upstart}
    
    packageArchetype.java_server
    
    serverLoading in Debian := SystemV
    
    name := "testApp"
    
    version := "1.0"
    
    organization := "com.testApp"
    
    scalaVersion := "2.10.3"
    
    maintainer in Debian := "gdc <aaa@aaa.com>"
    
    packageSummary in Debian := "testApp"
    
    packageDescription in Debian := "testApp"
    
    exportJars := true