Reputation: 1031
I'm just curious if there is some nice way to do that with Akka packaging.
I found some examples here, but it was created for rpm
build and I'm using these two plugins in my build.sbt
:
.enablePlugins(AkkaAppPackaging)
.enablePlugins(UniversalPlugin)
Actually I figured out one workaround by copying sigar libraries manually to directory where application starter script is generated.
There is also a need to set -Djava.library.path=./sigar
to appropriate directory where sigar libraries are located, this can be set in build.sbt
or changed later manually in generated scripts, by changing the JAVA_OPTS
.
Upvotes: 3
Views: 623
Reputation: 1314
Here is what I did
lazy val sigarJavaOpts = "-Djava.library.path=./sigar"
libraryDependencies ++= Dependencies.sigar
mappings in Universal ++= MappingsHelper directory getClass.getClassLoader.getResource("sigar").getFile
bashScriptExtraDefines += s"""addJava "$sigarJavaOpts" """
javaOptions in run += sigarJavaOpts
Note that I placed sigar files in my resources folder. You might also need to import from the following
import com.typesafe.sbt.SbtNativePackager.Universal
import com.typesafe.sbt.packager.MappingsHelper
import com.typesafe.sbt.packager.Keys.bashScriptExtraDefines
Also I do have a Dependencies object in which I have
val sigar = Seq(
"org.fusesource" % "sigar" % "1.6.4"
)
Upvotes: 2