= Creating an Uberjar

Edge provides a script for running pack to build an uberjar.
To use it, you can simply run the below from your project sub-directory (the same folder as your deps.edn).

[source,shell]
----
$ ../bin/onejar -A:prod --args '-m edge.main' project.jar
----

The `-A:prod` indicates an alias you would like to have its `:extra-deps` and `:paths` included in your resulting jar.
`--args` are default arguments to your jar, in this case we are specifying that the application should run edge.main, part of the edge production modules.

You can run this jar in production quite easily:

[source,shell]
----
$ java -Xmx1G -jar project.jar
----

We recommend that you specify the memory usage of your JVM, as the default on Java 6+ is usually insufficient for hosts run only this JVM process.
A rule of thumb is to use 2/3rds of the memory of your host.

= Creating an Uberjar

== OneJar

Edge provides a script for running pack to build an uberjar.
To use it, you can simply run the below from your project sub-directory (the same folder as your deps.edn).

[source,shell]
----
$ ../bin/onejar -A:prod --args '-m edge.main' project.jar
----

The `-A:prod` indicates an alias you would like to have its `:extra-deps` and `:paths` included in your resulting jar.
`--args` are default arguments to your jar, in this case we are specifying that the application should run edge.main, part of the edge production modules.

== Capsule 

Build a capsule uberjar using this command: 

[source,shell]
----
$ ../bin/capsule -m edge.main -e 'target/prod' -A:prod project.jar
----

If you are using clojurescript in your project make sure you run this command first: 

[source,shell]
----
$ clojure -A:build:build/once
----

It will build the clojurescript files and put them in the correct folder to be included in the uberjar.  

== Running the jar

You can run the produced jar in production quite easily:

[source,shell]
----
$ java -Xmx1G -jar project.jar
----

We recommend that you specify the memory usage of your JVM, as the default on Java 6+ is usually insufficient for hosts run only this JVM process.
A rule of thumb is to use 2/3rds of the memory of your host.



Add docs for how to use the capsule command
Add docs for how to use the capsule command