Running multiple applications with sbt

I have installed my directory structure.

src/main/scala/main/Main.scala
src/main/scala/scripts/MainScript.scala

A script is a background job to be run.

I used sbt-assemblyearlier to pack the main file into a jar to be deployed, but I'm not sure how to create two separate jars using sbt-assemblyor sbt-native-packager. How can I do this and what will be the best approach to this problem?

I would like to do something similar to this.

java -jar main.jar $PORT
java -jar scriptMain.jar
+4
source share
1 answer

One way to solve this only with native-packager would be as follows.

  • Put all the main classes in src/main/scala
  • Determine mainClass in Compile := Some("foo.bar.Main")which should be run by default.
  • src/universal/bin, . script, native-packager -main , .

(, zip, rpm, deb), . , myApp, bin, otherApp1/ otherApp2

lib/ (jars live here)
conf/ (configuration files here, if any)
bin/
  myApp
  otherApp1
  otherApp2

, script ( bash -foo SO). (otherApp1, otherApp2) , , native-packager script (myApp).

№ 633, .

, ,

+1

All Articles