Skip to content

Commit

Permalink
add info on how to run an uberjar built with tools.build in the guide,
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Nov 11, 2021
1 parent 9e3d853 commit c4e9477
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions content/guides/tools_build.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,26 @@ When preparing an application, it is common to compile the full app + libs and a
:class-dir class-dir})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis}))
:basis basis
:main my.lib.main}))
----

The deps.edn and build execution will look the same as the prior example.

You can create the uber jar build with:

[source,clojure]
[source]
----
clj -T:build uber
----

The output of this build will be an uberjar at `target/lib1-1.2.100-standalone.jar`. That jar contains both a compiled version of this project and all of its dependencies. The uberjar will have a manifest referring to the `my.lib.main` namespaces (which should have a `-main` method) and can be invoked like this:

[source]
----
java -jar target/lib1-1.2.100-standalone.jar
----

== Parameterized builds

In the builds above we did not parameterize any aspect of the build, just chose which functions to call. You may find that it's useful to parameterize your builds to differentiate dev/qa/prod, or version, or some other factor. To account for function chaining at the command line, it is advisable to establish the common set of parameters to use across your build functions and have each function pass the parameters along.
Expand Down

0 comments on commit c4e9477

Please sign in to comment.