honeyAndSw / vertx-microservices-workshop-scala

Scala Vert.x project inspired by vertx-microservices-workshop
3 stars 0 forks source link

[sbt] Build & Packaging #1

Open honeyAndSw opened 8 years ago

honeyAndSw commented 8 years ago

1) sbt - Directory structure 2) Organizing the build 3) Plugins

Multi-project - sbt - Multi-project builds - Buidling Multi-module Projects With Sbt

honeyAndSw commented 8 years ago
packageOptions += ManifestAttributes(
  ("Main-Verticle", "scala:io.vertx.workshop.quote.GeneratorConfigVerticle"))

Using the Launcher in fat jars

To use the Launcher class in a fat-jar just set the Main-Class of the MANIFEST to io.vertx.core.Launcher. In addition, set the Main-Verticle MANIFEST entry to the name of your main verticle. By default, it executed the run command. However, you can configure the default command by setting the Main-Command MANIFEST entry. The default command is used if the fat jar is launched without a command.

sbt - Configure packaging : Read MANIFEST in build.sbt

packageOptions in (Compile, packageBin) +=  {
  val file = new java.io.File("META-INF/MANIFEST.MF")
  val manifest = Using.fileInputStream(file)( in => new java.util.jar.Manifest(in) )
  Package.JarManifest( manifest )
}
honeyAndSw commented 8 years ago
honeyAndSw commented 8 years ago

Java Sources