Reputation: 1835
For our test servers, we want to package our tests in a debian. In sbt, I can generate the test-jar using:
publishArtifact in Test := true
I've looked into using member in Universal
and addArtifact()
but I am having trouble finding a solution.
How do I add the test-jar into the package?
Upvotes: 0
Views: 309
Reputation: 3641
There are two options.
This is very simply done with this small snippet you can add to your build.sbt
mappings in Universal += {
// generates the test package
val testjar = (packageBin in Test).value
// maps this file to your lib folder in your output package
testjar -> s"lib/${testjar.getName}"
}
This will generate the test package and publishes it, too. But it won't be added to the debian package.
import com.typesafe.sbt.packager.SettingsHelper
SettingsHelper.addPackage(Debian, packageBin in Test, "jar")
Upvotes: 2