Multi Module SBT projects issues - scala

I am working on designing a multi module project in SBT.
The idea is to build two subprojects in SBT with one subproject having Apache spark 2.3 dependency and
the other one with Apache Spark 2.4 dependency. Each sub project should be capable of building individual
jars. I am pasting the build.sbt. While I try to run sbt assembly on each of these sub projects.
I am getting the below error.I tried removing the cache folder in .ivy2 and tried
recreating the project structure.
Error message(included relevant logs only)
[IJ]> multi2/assembly
[info] Including from cache: jackson-xc-1.9.13.jar
[info] Including from cache: minlog-1.3.0.jar
[warn] Merging 'META-INF\ASL2.0' with strategy 'discard'
[warn] Merging 'META-INF\DEPENDENCIES' with strategy 'discard'
[error] C:\Users\user_home\.ivy2\cache\org.apache.spark\spark-core_2.11\jars\spark-core_2.11-2.4.3.jar:org/apache/spark/unused/UnusedStubClass.class
[error] C:\Users\user_home\.ivy2\cache\org.apache.spark\spark-launcher_2.11\jars\spark-launcher_2.11-2.4.3.jar:org/apache/spark/unused/UnusedStubClass.class
[error] C:\Users\user_home\.ivy2\cache\org.apache.spark\spark-tags_2.11\jars\spark-tags_2.11-2.4.3.jar:org/apache/spark/unused/UnusedStubClass.class
[error] C:\Users\user_home\.ivy2\cache\org.spark-project.spark\unused\jars\unused-1.0.0.jar:org/apache/spark/unused/UnusedStubClass.class
Likewise there are other classes that cause errors as above..
Please suggest, and let me know for any additional information.
name := "testrepo"
organization in ThisBuild := "com.yt"
scalaVersion in ThisBuild := "2.11.8"
scalaBinaryVersion := "2.11"
lazy val common = (project in file("common"))
.settings(
name := "common",
commonSettings,
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7",
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7",
dependencyOverrides += "com.fasterxml.jackson.module" %% "jackson-module-scala" %
dependencyOverrides += "io.netty" % "netty" % "3.9.9.Final",
dependencyOverrides += "commons-net" % "commons-net" % "2.2",
dependencyOverrides += "com.google.guava" % "guava" % "11.0.2",
dependencyOverrides += "com.google.code.findbugs" % "jsr305" % "1.3.9",
libraryDependencies ++= commonDependencies
)
.disablePlugins(AssemblyPlugin)
lazy val multi1 = (project in file("multi1"))
.settings(
name := "multi1",
commonSettings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq(
dependencies.spark23
)
)
.dependsOn(
common
)
lazy val multi2 = (project in file("multi2"))
.settings(
name := "multi2",
commonSettings,
assemblySettings,
libraryDependencies ++= commonDependencies ++ Seq(
dependencies.spark24
)
)
.dependsOn(
common
)
/*val overrides = Seq("com.fasterxml.jackson.core" % "jackson-core" % "2.8.7",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7",
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.8.7") */
// DEPENDENCIES
lazy val dependencies =
new {
val hivejdbc="org.apache.hive" % "hive-jdbc" % "0.13.0" % "provided"
val spark23V = "2.3.0.cloudera3"
val spark24V="2.4.3"
val spark23="org.apache.spark" %% "spark-core" % spark23V
val spark24="org.apache.spark" %% "spark-core" % spark24V
}
lazy val commonDependencies = Seq(
dependencies.hivejdbc
)
lazy val compilerOptions = Seq(
"-unchecked",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-deprecation",
"-encoding",
"utf8"
)
lazy val commonSettings = Seq(
scalacOptions ++= compilerOptions,
resolvers ++= Seq(
"Local Maven Repository" at "file://" + Path.userHome.absolutePath + "/.m2/repository",
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
)
)
lazy val assemblySettings = Seq(
assemblyJarName in assembly := name.value + ".jar",
assemblyMergeStrategy in assembly := {
case PathList("org.apache.spark", "spark-core_2.11", xs # _*) => MergeStrategy.last
case PathList("META-INF", xs # _*) => MergeStrategy.discard
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)

Related

Scala module 2.8.11 requires Jackson Databind version >= 2.8.0 and < 2.9.0

I'm using Scala 2.11 and Spark 2.4.3 for our AWS glue jobs. Recently, I got the error message below in our the build pipeline.
Cause: com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.8.11 requires Jackson Databind version >= 2.8.0 and < 2.9.0
I've tried -
Change the the jackson-module-scala version from 2.8.11 to 2.12.0. This fixed the build pipeline, but I get a different error message in the glue job
Exception in User Class: java.lang.ExceptionInInitializerError.
Change the jackson-module-scala version from 2.8.11 to 2.13.1. I refactored code to get the unit tests, and fix the build pipeline, but in the glue job get the error message below
Exception in User Class: java.lang.VerifyError : Bad return type
I've tried added dependencyOverrides with jackson-module-scala version 2.12.0. The build pipeline would work, but the glue job would fail.
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7"
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7"
dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.8.7"
Got any ideas what I'm doing wrong or how I can fix my issue?
See below for the build.sbt file
name in ThisBuild := "etl"
organization in ThisBuild := "XXXXXXXXXX"
scalaVersion in ThisBuild := "2.11.12"
version in ThisBuild := "0.2"
addCommandAlias("sanity", ";clean ;compile ;test ;scalafmtAll ;scalastyle ;assembly")
lazy val framework = project.settings(settings, libraryDependencies ++= commonDependencies)
lazy val scripts = project
.settings(settings, libraryDependencies ++= commonDependencies)
.dependsOn(framework % "compile->compile;test->test")
lazy val settings = Seq(
test in assembly := {},
scalacOptions ++= Seq(),
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
"aws-glue-etl-artifacts" at "https://aws-glue-etl-artifacts.s3.amazonaws.com/release/"
),
assemblyMergeStrategy in assembly := {
case PathList("META-INF", "io.netty.versions.properties", xs # _*) => MergeStrategy.singleOrError
case "module-info.class" => MergeStrategy.discard
case x: String if x.contains("UnusedStubClass") => MergeStrategy.first
case y =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(y)
}
)
lazy val commonDependencies = Seq(
"com.amazonaws" % "AWSGlueETL" % "1.0.0" % Provided,
"com.databricks" %% "spark-xml" % "0.8.0",
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
"org.scalamock" %% "scalamock" % "4.4.0" % Test,
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.8.11",
"io.netty" % "netty-all" % "4.1.17.Final" % Test,
"org.apache.spark" %% "spark-avro" % "2.4.3",
"com.crealytics" %% "spark-excel" % "0.13.6"
)
fork in ThisBuild := true
parallelExecution in ThisBuild := true
testForkedParallel in ThisBuild := false
logBuffered in ThisBuild := false
testOptions in ThisBuild += Tests.Argument(TestFrameworks.ScalaTest, "-oDFG")
javaOptions ++= Seq(
"-XX:+CMSClassUnloadingEnabled",
"-XX:MaxMetaspaceSize=512M",
"-XX:MetaspaceSize=256M",
"-Xms512M",
"-Xmx2G",
"-XX:MaxPermSize=2048M"
)
The function below uses the Jackson module scala 2.8.11 (up to 2.12.0)
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
object JsonUtils {
private val mapper = new ObjectMapper() with ScalaObjectMapper
mapper.registerModule(DefaultScalaModule)
def fromJson[T](json: String)(implicit m: Manifest[T]): T = {
mapper.readValue[T](json)
}
}
U need to override it, like this:
dependencyOverrides ++= Seq(
"com.fasterxml.jackson.core" % "jackson-databind" % versions("jackson"),
"com.fasterxml.jackson.core" % "jackson-core" % versions("jackson"))
I've resolved my issue.
In the function, I changed the library import from
import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper
to
import com.fasterxml.jackson.module.scala.ScalaObjectMapper
In the build.sbt, I added the following lines
libraryDependencies += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.12.0"
dependencyOverrides += "com.fasterxml.jackson.module" % "jackson-module-scala_2.11" % "2.6.7.1"

How to reference a project definition in a parent build.sbt file?

I'm playing around with the scala-forklift library and wanted to test an idea by modifying the code in the library and example project.
This is how the project is structured:
/build.sbt -> Contains definition of scala-forklift-slick project (including its dependencies) in the form of:
lazy val slickMigrationProject =
Project("scala-forklift-slick", file(...))
.dependsOn(...)
.settings(...)
...
/example/build.sbt -> References scala-forklift-slick via its Maven package.
My goal is to replace the scala-forklift-slick Maven package reference with a reference to the code in the parent directory, perhaps via .dependsOn(slickMigrationProject)?
Attempts:
According to the documentation:
Any .sbt files in foo, say foo/build.sbt, will be merged with the build definition for the entire build, but scoped to the hello-foo project.
But this does not seem to apply to lazy val values, as I can't access slickMigrationProject from the parent project directly.
I have been successful copying the entire contents of /example/build.sbt into /build.sbt and tweaking things a bit, but I was wondering if there was a better "one-liner" kind of solution instead.
Here is what my combined /build.sbt file looks like:
val repoKind = SettingKey[String]("repo-kind",
"Maven repository kind (\"snapshots\" or \"releases\")")
lazy val slickVersion = "3.3.3"
lazy val scala212 = "2.12.11"
lazy val scala213 = "2.13.1"
lazy val supportedScalaVersions = List(scala212, scala213)
lazy val coreDependencies = libraryDependencies ++= List(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"com.typesafe" % "config" % "1.3.2",
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.0.1.201506240215-r"
)
lazy val slickDependencies = List(
"com.typesafe.slick" %% "slick" % slickVersion,
"com.typesafe.slick" %% "slick-codegen" % slickVersion,
"io.github.nafg" %% "slick-migration-api" % "0.7.0",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.0.0"
)
lazy val slickDependenciesWithTests = slickDependencies ++ List(
"org.scalatest" %% "scalatest" % "3.1.0",
"com.lihaoyi" %% "ammonite-ops" % "2.0.4",
"commons-io" % "commons-io" % "2.6",
"com.typesafe.slick" %% "slick-hikaricp" % slickVersion,
"com.h2database" % "h2" % "1.4.200",
"org.xerial" % "sqlite-jdbc" % "3.8.11.2",// 3.30.1 crashes SQLiteCommandTests
"mysql" % "mysql-connector-java" % "5.1.38",
"org.postgresql" % "postgresql" % "42.2.9",
"org.hsqldb" % "hsqldb" % "2.5.0",
"org.apache.derby" % "derby" % "10.14.2.0",
"ch.qos.logback" % "logback-classic" % "1.2.3"
).map(_ % "test")
lazy val commonSettings = Seq(
organization := "com.liyaos",
licenses := Seq("Apache 2.0" ->
url("https://github.com/lastland/scala-forklift/blob/master/LICENSE")),
homepage := Some(url("https://github.com/lastland/scala-forklift")),
scalaVersion := scala213,
scalacOptions += "-deprecation",
scalacOptions += "-feature",
resolvers += Resolver.jcenterRepo,
publishMavenStyle := true,
publishArtifact in Test := false,
repoKind := { if (version.value.trim.endsWith("SNAPSHOT")) "snapshots"
else "releases" },
publishTo := { repoKind.value match {
case "snapshots" => Some("snapshots" at
"https://oss.sonatype.org/content/repositories/snapshots")
case "releases" => Some("releases" at
"https://oss.sonatype.org/service/local/staging/deploy/maven2")
}},
credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"),
pomExtra := (
<scm>
<url>git#github.com:lastland/scala-forklift.git</url>
<connection>scm:git:git#github.com:lastland/scala-forklift.git</connection>
</scm>
<developers>
<developer>
<id>lastland</id>
<name>Yao Li</name>
</developer>
</developers>))
// Derby is running is secured mode since version 10.12.1.1, so security manager must be disabled for tests
// https://stackoverflow.com/questions/48008343/sbt-test-does-not-work-for-spark-test
// https://issues.apache.org/jira/browse/DERBY-6648
Test / testOptions += Tests.Setup(() => System.setSecurityManager(null))
lazy val root = Project(
"scala-forklift", file(".")).settings(
crossScalaVersions := Nil,
publishArtifact := false).aggregate(
coreProject, slickMigrationProject, plainMigrationProject, gitToolProject, example)
lazy val coreProject = Project(
"scala-forklift-core", file("core")).settings(
commonSettings:_*).settings {Seq(
crossScalaVersions := supportedScalaVersions,
coreDependencies
)}
lazy val slickMigrationProject = Project(
"scala-forklift-slick", file("migrations/slick")).dependsOn(
coreProject).settings(commonSettings:_*).settings { Seq(
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= slickDependenciesWithTests
)}
lazy val plainMigrationProject = Project(
"scala-forklift-plain", file("migrations/plain")).dependsOn(
coreProject).settings(commonSettings:_*).settings(crossScalaVersions := supportedScalaVersions)
lazy val gitToolProject = Project(
"scala-forklift-git-tools", file("tools/git")).dependsOn(
coreProject).settings(commonSettings:_*).settings(crossScalaVersions := supportedScalaVersions)
///////////////////////////////////////////////
name := "forklift-slick-example"
addCommandAlias("mgm", "example/migration_manager/run")
addCommandAlias("mg", "example/migrations/run")
lazy val exampleCommonSettings = Seq(
organization := "com.liyaos",
version := "2.0",
scalaVersion := "2.13.1",
scalacOptions += "-deprecation",
scalacOptions += "-feature",
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.jcenterRepo,
)
lazy val loggingDependencies = List(
"org.slf4j" % "slf4j-nop" % "1.6.4" // <- disables logging
)
lazy val exampleSlickDependencies = List(
"com.typesafe.slick" %% "slick" % slickVersion
)
lazy val dbDependencies = List(
"com.typesafe.slick" %% "slick-hikaricp" % slickVersion
,"com.h2database" % "h2" % "1.4.200"
)
lazy val forkliftDependencies = List(
// "com.liyaos" %% "scala-forklift-slick" % forkliftVersion
)
lazy val appDependencies = dbDependencies ++ loggingDependencies
lazy val migrationsDependencies =
dbDependencies ++ forkliftDependencies ++ loggingDependencies
lazy val migrationManagerDependencies = dbDependencies ++ forkliftDependencies
lazy val example = Project("example", file("example")).aggregate(
app, migrations, migrationManager, generatedCode, tools).settings(
exampleCommonSettings:_*)
lazy val app = Project("app", file("example/app"))
.dependsOn(generatedCode)
.settings(exampleCommonSettings:_*)
.settings {libraryDependencies ++= appDependencies}
lazy val migrationManager = Project("migration_manager", file("example/migration_manager"))
.dependsOn(slickMigrationProject)
.settings(exampleCommonSettings:_*)
.settings {libraryDependencies ++= migrationManagerDependencies}
lazy val migrations = Project("migrations", file("example/migrations"))
.dependsOn(generatedCode, migrationManager, slickMigrationProject)
.settings(exampleCommonSettings:_*)
.settings {libraryDependencies ++= migrationsDependencies}
lazy val tools = Project("git-tools", file("example/tools/git"))
.dependsOn(slickMigrationProject, gitToolProject)
.settings(commonSettings:_*)
.settings {
libraryDependencies ++= forkliftDependencies ++ List(
// "com.liyaos" %% "scala-forklift-git-tools" % forkliftVersion,
"com.typesafe" % "config" % "1.3.0",
"org.eclipse.jgit" % "org.eclipse.jgit" % "4.0.1.201506240215-r"
)
}
lazy val generatedCode = Project("generate_code", file("example/generated_code"))
.settings(exampleCommonSettings:_*)
.settings {libraryDependencies ++= exampleSlickDependencies}
Question:
Is there a simple way I can replace the scala-forklift-slick Maven package reference in /example/build.sbt with a link to the existing scala-forklift-slick project definition in the parent directory's build.sbt so I can use .dependsOn(...) instead?
Or maybe it's better to do something like build scala-forklift-slick and use a local disk package resolver?
Luis Miguel Mejía Suárez's comment worked perfectly and was the easier approach.
In the context of this project, all I had to do was:
Append -SNAPSHOT to the version in /version.sbt (should not be needed normally but for this project I had to do this)
Run sbt publishLocal in the parent project.
After this, the example project (which already targets the -SNAPSHOT version) is able to pick up the locally built package.

assemblyMergeStrategy type error

I am trying to set up a small project to have an aws-lambda written in scala:
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint")
lazy val root = (project in file(".")).
settings(
name := "xxx",
version := "0.1",
scalaVersion := "2.12.3",
retrieveManaged := true
)
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-lambda-java-core" % "1.1.0" % Provided,
"com.amazonaws" % "aws-lambda-java-events" % "1.1.0" % Provided,
"org.scalatest" % "scalatest" % "2.2.6" % Test
)
scalacOptions += "-deprecation"
assemblyMergeStrategy in assembly <<= (assemblyMergeStrategy in assembly) {
(old) => {
case PathList("META-INF", xs # _*) => MergeStrategy.discard
case x => MergeStrategy.first
}
}
Results in :
xxx/build.sbt:25: error: not found: value assemblyMergeStrategy
assemblyMergeStrategy in assembly <<= (assemblyMergeStrategy in
assembly) { ^ [error] Type error in expression
The source of inspiration was this blog.
Also tried the provided version as mergeStrategy might have been replaced by assemblyMergeStrategy.
Did you reference assembly plugin in your project/plugins.sbt file?
assemblyMergeStrategy is defined by the plugin.
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")

unresolved dependency: com.kyleu#jdub-async_2.11;1.0: not found

plugin.sbt: I define resolvers and plugins here.
logLevel := Level.Debug
resolvers += "JCenter repo" at "https://bintray.com/bintray/jcenter/"
resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
resolvers += "mvnrepository" at "http://mvnrepository.com/artifact/"
resolvers += "Atlassian Releases" at "https://maven.atlassian.com/public/"
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.3")
addSbtPlugin("com.vmunier" % "sbt-play-scalajs" % "0.2.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-gzip" % "1.0.0")
build.sbt: There are 3 projects in this file: shared, client and server. Client is a Scala.js application, server is a Play application and shared is a project which code is used in server and client projects.
import sbt.Project.projectToRef
lazy val clients = Seq(client)
lazy val scalaV = "2.11.6"
lazy val server = (project in file("server")).settings(
scalaVersion := scalaV,
scalaJSProjects := clients,
pipelineStages := Seq(scalaJSProd, gzip),
libraryDependencies ++= Seq(
"com.vmunier" %% "play-scalajs-scripts" % "0.3.0",
"org.webjars" % "jquery" % "1.11.1",
"org.json4s" %% "json4s-jackson" % "3.2.11",
"com.github.benhutchison" %% "prickle" % "1.1.7",
"com.kyleu" %% "jdub-async" % "1.0",
specs2 % Test
)
).enablePlugins(PlayScala).
aggregate(clients.map(projectToRef): _*).
dependsOn(exampleSharedJvm)
lazy val client = (project in file("client")).settings(
scalaVersion := scalaV,
persistLauncher := true,
persistLauncher in Test := false,
sourceMapsDirectories += exampleSharedJs.base / "..",
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.8.0",
"org.scala-js" %%% "scala-parser-combinators" % "1.0.2",
"com.github.benhutchison" %%% "prickle" % "1.1.7"
)
).enablePlugins(ScalaJSPlugin, ScalaJSPlay).
dependsOn(exampleSharedJs)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")).
settings(scalaVersion := scalaV).
jsConfigure(_ enablePlugins ScalaJSPlay).
jsSettings(sourceMapsBase := baseDirectory.value / "..")
lazy val exampleSharedJvm = shared.jvm
lazy val exampleSharedJs = shared.js
onLoad in Global := (Command.process("project server", _: State)) compose (onLoad in Global).value
During compilation of server project I got an error: unresolved dependency: com.kyleu#jdub-async_2.11;1.0: not found. How to fix this issue?

SBT Web Plugin : Error getting ScopedKey(Scope(This,Select(ConfigKey(container)),This,This),full-classpath)

I'm trying to set up scala web project with sbt. I've following settings.
scala 2.9.0-1
sbt 0.11.0
xsbt-web-plugin 0.2.1
project/plugins.sbt
libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.1"))
project/TaskTrackerBuild.scala
import sbt._
import com.github.siasia._
import WebPlugin._
import PluginKeys._
import Keys._
/**
* Main sbt build file for the task-tracker project.
*
*/
object TicketingCoreProject extends Build {
val ticketingVersion = "1.0.0-SNAPSHOT"
val Organization = "org.sansoft"
val ScalaVersion = "2.9.0-1"
val jodaTime = "joda-time" % "joda-time" % "1.6"
val scalaTime = "org.scala-tools.time" % "time_2.8.0" % "0.2"
val casbah = "com.mongodb.casbah" % "casbah_2.9.0-1" % "2.1.5.0"
val Slf4jLog4jDep = "org.slf4j" % "slf4j-log4j12" % "1.6.1"
val ScalaCheckDep = "org.scala-tools.testing" %% "scalacheck" % "1.9" % "test"
val JUnitDep = "junit" % "junit" % "4.8.2" % "test"
val scalaTesting = "org.scala-tools.testing" %% "specs" % "1.6.8" % "test"
//val scctSbt = "ch.craven" %% "scct-plugin" % "0.2"
val vaadin = "com.vaadin" % "vaadin" % "6.7.0"
val jettyWebApp = "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "container"
val jettyPlus = "org.eclipse.jetty" % "jetty-plus" % "7.3.0.v20110203" % "container"
val repositories = Seq(
ScalaToolsSnapshots,
"typesafe releases" at "http://repo.typesafe.com/typesafe/releases",
"typesafe snapshots" at "http://repo.typesafe.com/typesafe/snapshots",
"scct-repo" at "http://mtkopone.github.com/scct/maven-repo")
def publishToRepository = Some(Resolver.file("Local Maven Repository", Path.userHome / ".m2" / "repository" asFile))
lazy val baseSettings = Defaults.defaultSettings ++ Seq(
version := ticketingVersion,
organization := Organization,
scalaVersion := ScalaVersion,
publishMavenStyle := true,
publishTo := publishToRepository,
resolvers ++= repositories,
checksums := Nil
)
lazy val parent = Project("taskTrackerParent", file("."),
settings = baseSettings ++ Seq(
name := "task-tracker-parent"
))
lazy val core = Project("core", file("core"),
settings = baseSettings ++ Seq(
name := "core",
libraryDependencies ++= Seq(
jodaTime,
scalaTime,
scalaTesting,
ScalaCheckDep,
casbah,
jodaTime,
scalaTime)))
lazy val web = Project("web", file("web"),
settings = baseSettings ++ webSettings ++ Seq(
name := "web",
libraryDependencies ++= Seq(
jodaTime,
scalaTime,
scalaTesting,
ScalaCheckDep,
casbah,
jodaTime,
scalaTime,
vaadin,
jettyWebApp,
jettyPlus))) dependsOn(core)
}
When I try to start sbt with this build file I get following error.
[error] Error getting ScopedKey(Scope(This,Select(ConfigKey(container)),This,This),full-classpath)
[error] Use 'last' for the full log.
If I remove the configuration webSettings from the web project sbt project compiles fine.
What have I done wrong in this???
Thanks in advance.
I had exactly the same issue when I tried to use webSettings.
Today I found a solution on project-doc:
https://github.com/siasia/xsbt-web-plugin/wiki/Deployment-scenarios
The plugin works when I change from webSettings to webAppSettings.