Configuring an Instance from the Command Line

As described in Deploying From the Command Line, the starting and configuration of an instance has to be done in its entirety on one line.

The options available can be seen by running the JAR with the --help option, or by consulting the Payara Micro Command Line Options section in the Appendices.

The general structure of starting, configuring, and deploying an application to an instance is as follows:

java -jar payara-micro.jar _--option1_ _--option2_ ...

As an example, see below for starting an instance with a non-default HTTP port:

java -jar payara-micro.jar --port 2468

Read configuration from a file

With --domainConfig option, it is possible to define multiple options in a configuration file. This option would override the default Payara Micro configuration completely. The provided file must conform to the same structure as the domain.xml file in a Payara Server domain.

The --rootDir option sets the root configuration directory and saves the configuration across restarts. If empty, this directory will be filled by the default configuration, including the domain.xml file.

Precedence

If specifying multiple options at once, the following precedence is followed:

rootDir < domainConfig < autoBindHttp | autoBindSsl < port | sslPort

In human language:

  • The domain.xml in the directory specified by the rootDir option (if one exists) is overridden by the domain.xml specified with the domainConfig option

  • The HTTP and HTTPS port numbers specified in either of these domain.xml files are overridden to be the default values of 8080 and 8081 when the autoBindHttp or autoBindSsl options are enabled respectively.

  • These default port values are then overridden in turn by the port numbers specified with the port or sslPort options.