server package command
Packages an Open Liberty server, its resources, and applications in a compressed file that you can store, distribute, or deploy to a different location.
You can select the parts of your Open Liberty server installation to package. You can package an application with a full or a minimal Open Liberty runtime environment, or without an Open Liberty runtime environment so that the application can be deployed on an existing Open Liberty installation.
Usage examples
Generate a ZIP file named myserver.zip
that includes all files in the Open Liberty installation directory with the myserver
server files:
server package myserver --include=all
Generate a ZIP file named package_myserver.zip
that has only the myserver
server files for deployment on an existing Open Liberty runtime installation, such as in a Docker container:
server package myserver --archive=package_myserver.zip --include=usr
Generate a ZIP file, myserver.zip
, with the root folder named mywlp
instead of wlp
:
server package myserver --server-root="mywlp"
Package the Open Liberty runtime into a ZIP file, wlp.zip
, that does not include the usr
directory, so it has no servers or applications:
server package --include=wlp
Package the Open Liberty runtime into a ZIP file named myPackage.zip
and put it in the C:\temp
directory:
server package --include=wlp --archive=C:\temp\myPackage.zip
Generate a runnable JAR file of the myserver
server named myserver.jar
:
server package myserver --include=runnable
Generate a minimal runnable JAR file of the myserver
server named package_myserver.jar
to the C:\temp
directory:
server package myserver --archive="C:\temp\package_myserver.jar" --include=minify,runnable
Generate a TAR file of the myserver
server named package_myserver.tar
to the C:\temp
directory:
server package myserver --archive="C:\temp\package_myserver.tar"
Package a server that supports only Linux:
server package myserver --archive=linux.zip --include=minify --os=Linux
Package a server with Linux support, but no Windows support:
server package myserver --archive=small.zip --include=minify --os=Linux,-Win32
Syntax
Run the command from the path_to_liberty/bin
directory. To package a server, stop the server before running the command.
server package serverName [options]
- serverName
-
The name of the server to run the command against. A server name is needed to package a server. A server name is not needed to package the Open Liberty runtime.
- options
-
One or more optional parameters.
Options
Option | Description |
---|---|
--archive="package_file_name.zip" |
Specifies a target file for the package operation. This path can be either a relative path, which is relative to the installation root directory of Open Liberty, or an absolute path. The default archive target is a ZIP file with the server name, which is stored in the installation root directory. Use quotation marks if the value contains spaces. ZIP, JAR, TAR, and TAR GZ are all valid archive file options.
|
--include=all |
Packages all the files in the Open Liberty installation directory. If the |
--include=usr |
Packages the files in the |
--include=wlp |
Packages the files in the |
--include=minify |
Packages only the parts of the runtime environment and files in the |
--include=runnable |
Use only with the |
--os=os_value,os_value,… |
Use only with the |
--server-root="root server folder in archive" |
Specifies the root server folder name in the archive file. |
Exit codes
The following exit codes are available for the server package
command and the equivalent executable JAR file ws-server.jar
:
- 0
-
OK. 0 indicates successful completion of the requested operation.
- 1
-
1 indicates that the JVM options that were used are not valid.
- 2
-
2 indicates that the server does not exist.
- 3
-
3 indicates that an unsupported action was called on a running server. For example, the server is running when the package action is called.
- >=20
-
Exit codes greater than or equal to 20 indicate that an error occurred while performing the request. Messages are printed and captured in log files with more information about the error.