3

I've been trying to find the way to package a web application composed by multiple projects into a single war. The only usefull plugin I've found for sbt is xsbt-web-plugin. I'm trying to use the War plugin inside that github hosted project, but only de dependencies of the web project are included in WEB-INF/lib (not the other projects defined in the build neither their dependencies). My build file is:

import sbt._
import Keys._
import com.github.siasia._
import WarPlugin.warSettings

object BuildSettings {

  import Dependencies._

  val buildOrganization = "ar.edu.itba.it"
  val buildVersion = "1.27"

  val hibernateVersion = "3.6.7.Final"
  val guiceVersion = "3.0"
  val wicketVersion = "1.5.4"
  val jerseyVersion = "1.12"

  val buildSettings = Defaults.defaultSettings ++ Seq(
    organization := buildOrganization,
    version := buildVersion,
    crossPaths := false,
    publishArtifact in (Compile, packageDoc) := false,
    publishArtifact in (Compile, packageSrc) := false,
    parallelExecution in ThisBuild := false,
    libraryDependencies ++= Seq(slf4j_api, slf4j_log4j12, junit, hamcrest_all,         mockito_all, h2, joda_time, guava, junit_interface),
    javacOptions ++= Seq("-source", "1.6", "-target", "1.6"),
    testOptions += Tests.Argument(TestFrameworks.JUnit))
}

object SgaBuild extends Build {
  import BuildSettings._
  import Dependencies._
  import com.github.siasia.WebPlugin._

  val compileAndTest = "test->test;compile->compile"

  lazy val root = Project(id = "sga", base = file(".")) aggregate (itba_common,     itba_common_wicket, itba_common_jpa, jasperreports_fonts_extensions, sga_backend, sga_rest,     sga_wicket) // settings (rootSettings: _*)

  lazy val itba_common = Project(id = "itba-common", base = file("itba-common"))     settings (buildSettings: _*)
  lazy val itba_common_jpa = Project(id = "itba-common-jpa", base = file("itba-common-    jpa")) dependsOn (itba_common % compileAndTest) settings (buildSettings: _*)
  lazy val itba_common_wicket = Project(id = "itba-common-wicket", base = file("itba-    common-wicket")) dependsOn (itba_common % compileAndTest, itba_common_jpa % compileAndTest)     settings (buildSettings: _*)
  lazy val jasperreports_fonts_extensions = Project(id = "jasperreports-fonts-    extensions", base = file("jasperreports-fonts-extensions")) settings (buildSettings: _*)
  lazy val sga_backend = Project(id = "sga-backend", base = file("sga-                backend")) dependsOn (itba_common % compileAndTest, itba_common_jpa % compileAndTest)     settings (buildSettings: _*)
  lazy val sga_rest = Project(id = "sga-rest", base = file("sga-rest")) dependsOn     (sga_backend % compileAndTest) settings (buildSettings: _*)

  lazy val sga_wicket = Project(id = "sga-wicket", base = file("sga-wicket")) dependsOn     (sga_backend % compileAndTest, sga_rest % compileAndTest, itba_common_wicket %     compileAndTest) settings ((buildSettings ++ warSettings(Compile)):_*)

}

object Resolvers {
  val wicketStuff = "Wicket Stuff Repository" at     "http://wicketstuff.org/maven/repository"
}

object Dependencies {

  import BuildSettings._

  ... // (plenty of ModuleIDs that are refered from 7 XXX.sbt)
}

Looking at the plugin code it seems it copy all the files from full-classpath configuration into lib directory, but when inspecting full-configuration it doesn't include all the required jars (the ones from the other 7 projects and their dependencies).

Is this the right plugin to use or there is another one?.

Thanks in advance!

0 Answers0