There are various answers to the question however none of them seem to be working for me.
I've built a rest api using Scalatra and I'm trying to generate a test jar.
Most people say to do this:
Project.inConfig(Test)(baseAssemblySettings)
assemblyJarName in (Test, assembly) := s"${name.value}-test-${version.value}.jar"
I've added those lines of code directly to the build but the test jar still doesn't generate. Perhaps I'm supposed to add those differently due to the ScalatraPlugin.
Here is my build configuration for sbt:
import java.nio.charset.Charset
import sbt._
import Keys._
import org.scalatra.sbt._
import com.earldouglas.xwp.JettyPlugin
import com.mojolly.scalate.ScalatePlugin._
import sbtassembly.AssemblyPlugin.baseAssemblySettings
import sbtassembly.AssemblyKeys.assemblyJarName
import sbtassembly.AssemblyKeys.assembly
object BuildAllTheStuff extends Build {
val Organization = "com.xxx"
val Name = "my-super-cool-project"
val Version = "1.0.0"
val ScalaVersion = "2.11.8"
val ScalatraVersion = "2.4.1"
Project.inConfig(Test)(baseAssemblySettings)
assemblyJarName in (Test, assembly) := s"${name.value}-test-${version.value}.jar"
lazy val project = Project (
Name,
file("."),
settings = ScalatraPlugin.scalatraSettings ++ scalateSettings ++ Seq(
organization := Organization,
name := Name,
version := Version,
scalaVersion := ScalaVersion,
resolvers += Classpaths.typesafeReleases,
resolvers += "Scalaz Bintray Repo" at "http://ift.tt/1s6xCLk",
libraryDependencies ++= Seq(
"org.scalatra" %% "scalatra" % ScalatraVersion
// remove other deps for brevity
))
).enablePlugins(JettyPlugin)
Aucun commentaire:
Enregistrer un commentaire