jeudi 23 juin 2016

Sbt-Web packageBin in Assets and unit tests accessing META-INF/resoucres/

For a project with the following layout:

src/main/assets
src/main/java
src/main/public

The Build.scala looks like:

import sbt._
import Keys._
import com.typesafe.sbt.web.Import._
import com.typesafe.sbt.web.SbtWeb

object ServiceImplBuild extends Build {
  lazy val root = Project(
    id = "root", base = file(".")
  ).enablePlugins(SbtWeb)
   .settings(
    (managedClasspath in Runtime) += (packageBin in Assets).value
  )
}

There is also a dependency to a webjar:

"org.webjars" % "bootstrap" % bootstrapVersion

Such a project given sbt test would be able to access all the Assets inside META-INF/resoucres/, but if I run the test suite in Intellij for example - it would not take META-INF/resoucres/ into classpath.

Aucun commentaire:

Enregistrer un commentaire