Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create one standalone jar using sbt? #9

Open
thinkerou opened this issue May 9, 2018 · 0 comments
Open

How to create one standalone jar using sbt? #9

thinkerou opened this issue May 9, 2018 · 0 comments
Assignees

Comments

@thinkerou
Copy link
Owner

thinkerou commented May 9, 2018

  • Background:

    Using the sbt package command, it creates a jar file but this jar will be without any dependencies which it can not run.
    To run it necessary to specify classpath arg to the libraries.

  • Wish:

    Maybe we wish a standalone runnable jar file.
    So we need to add the dependencies. To do this we can use assembly plugin for sbt, please see sbt-assembly, what it will do is create one jar file containing the project class files along with all of its dependencies. If we write an application, what we get is a double-clickable jar that we can execute from anywhere.

  • Solved:

    Afterward we can just run the sbt assembly command, it provides a fat jar file with all dependencies that you can deploy and run anywhere and at any time.

@thinkerou thinkerou self-assigned this May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant