Create standalone jar using SBT

前端 未结 5 932
孤独总比滥情好
孤独总比滥情好 2020-12-23 13:24

I was a heavy Maven user and now I\'m gradually using SBT for some of my projects.

I\'d like to know how could I use SBT to create a standalone Java project? This pr

5条回答
  •  借酒劲吻你
    2020-12-23 14:03

    I think the easiest way to produce a stand-alone jar with your project in it, is sadly not lying inside sbt.

    I personally use my IDE: Intellij to make the jar (through the 'build artifact' feature).

    Thanks to Intellij I can easily choose which library I want to include in the jar or not, (for instance the scala stl).

    IMHO, this is by far the simplest method to get an executable jar for your project.

    If you put the scala stl you can run your jar with the "java -jar" command, if you don't you have to run it somewhere with the correct version of scala installed with "scala".

提交回复
热议问题