Package the server. Run the following command.
If you do not specify a server name, defaultServer is
used. If you do not specify the --archive parameter,
the value of server_name is used for package_file_name,
and the compressed file is created in the ${server.output.dir} directory.
You can also use the --include option with this command. For example, the --include=all option packages the runtime binaries and the relevant files in the ${WLP_USER_DIR} directory; the --include=usr option packages only relevant files in the ${WLP_USER_DIR} directory, effectively excluding the runtime binaries from the compressed file.
If you use the --include=minify option,
the server command packages only those parts of
the runtime environment, and files in the ${WLP_USER_DIR} directory,
that are required to run the server. This option significantly reduces
the size of the resulting archive.
The parts of the runtime
environment that are retained by the minify operation
depend on the features that are configured in the server that you
are packaging. Only those features that are required to run the server
are retained, and the remaining features are removed. Therefore, you
cannot subsequently enable a feature that has been removed. For example,
if only the servlet-3.0 feature is retained, you
cannot subsequently enable the jpa-2.0 feature.
You
can repeat the minify operation to further reduce
the size of the archive if the configuration is changed. There is,
however, no reverse operation for the minify operation,
so if you later require one or more features that have been removed,
you must begin again with a complete Liberty profile server.
While
the minify operation is running, the server is temporarily
launched, and you will see associated messages. For this reason, you
cannot use the --include=minify option with a server
that is not able to be launched, but you can package it with the --include=all or --include=usr options.
You
can specify the operating systems that you want the packaged server
to support by using the --os option with the --include=minify option.
For
example, to package a server with z/OS® support
removed, use the following command:
server package --archive="nozos.zip" --include=minify --os=-z/OS
To
package a server with OS/400® support
retained, but z/OS support
removed, use the following command:
server package --archive="small.zip" --include=minify --os=OS/400,-z/OS
To
package a server that supports only Linux,
use the following command:
server package --archive="linux.zip" --include=minify --os=Linux