One task for war file creation: lein immutant war
. The task takes
the following options:
--dev
If specified, a devwar is created. This war doesn't include the app dependencies or src, and has a repl started automatically (unless disabled in project.clj - see below)--name foo
Overrides the default name of the war.--dest some/path
Location to drop the war. Defaults totarget/
, and is smart about the existence ofstandalone/deployments/
--resource-dir path/to/dir
A dir of resources to place in the top-level of the war. Useful for overriding WEB-INF/web.xml and friends. This shouldn't be the resources/ dir of your app, as that will be included inside the uberjar inside the war already. Can be relative to the app root or absolute. Can also be specified in project.clj, with the command-line switch taking precedence.
We may also expose --nrepl-host
and --nrepl-port
options.
Options can also be specified in project.clj:
:immutant {
:war {
;; defaults to projectname.war, supports placeholders:
;; %v for project version, %t for the type suffix (which
;; will be -dev for dev wars, '' for full wars)
:name "foo-%v%t" ;; will be foo-0.1.0.war, or foo-0.1.0-dev.war for --dev
;; defaults to :target-path
:dest "path/for/war"
;; contents placed at the top-level of the jar, useful for
;; overriding WEB-INF/web.xml. If, after copying these resources,
;; we don't have a web.xml, we'll add our own.
:resource-dir "path/to/dir"
;; if true, always generate a dev jar
:dev? true
;; by default, a nrepl will be started on localhost:random-port in
;; a dev war, and not started in a full war. To enable nrepl in a
;; full war, you'll have to specify at least a :start? here. Explicitly
setting :start? to falsey will disable the auto-repl in the dev war.
:nrepl {:host "foo"
:port 1234
;; defaults to .nrepl-port *and* target/nrepl-port. Can be
;; relative to app root or absolute. Absolute is the only
;; option when running as a full war.
:port-file "path/to/port/file"
:start? true}}}
By default, the war task will create an uberwar. There won't be an option for a slim, non-dev war, because such an artifact is useless in WildFly.
For the full war, we'll continue to use the uberjar inside of it, so any options for AOT, etc should be set using the uberjar options.
When we generate a web.xml
, it will be dropped in target/
as well to
allow for customization in a :resource-dir
.
Users might want to add something else to the WEB-INF other then the
web.xml
. For example, in Keycloak akeycloak.json
is included.