joesan
joesan

Reputation: 15385

Adding sbt native packager plugin in SBT

I have a very organized build file that is composed of the following scala files:

  1. Build.scala - the main Build file
  2. Dependencies.scala - where I define the dependencies and the versions
  3. BuildSettings.scala - where I define the build settings
  4. plugins.sbt

A snippet of the Build.scala is as below:

import sbt._
import Keys._

object MyBuild extends Build {

  import Dependencies._
  import BuildSettings._
  import NativePackagerHelper._

  // Configure prompt to show current project
  override lazy val settings = super.settings :+ {
    shellPrompt := { s => Project.extract(s).currentProject.id + " > " }
  }

  // Define our project, with basic project information and library dependencies
  lazy val project = Project("my-project", file("."))
    .settings(buildSettings: _*)
    .settings(
      libraryDependencies ++= Seq(
        Libraries.scalaAsync
        // Add your additional libraries here (comma-separated)...
      )
    ).enablePlugins(JavaAppPackaging, DockerPlugin)
}

All the 4 files that I mentioned above are in the same directory which is inside the project directory. But when I run this build file, I get the following error:

not found value: NativePackagerHelper

Any clues why his this?

Upvotes: 2

Views: 1294

Answers (1)

joesan
joesan

Reputation: 15385

I figured out what the problem was. I had to use the following in my build.properties

sbt.version=0.13.11

I originally had 0.13.6 and it was causing the import statements to fail!

Upvotes: 1

Related Questions