Payara Micro is distributed as a single .jar
file. However, at runtime, it creates and depends on a folder structure that is referred to as Root Configuration Directory or rootdir
.
This directory stores all of the instance configuration, deployed applications, as well as implementation .jar
files needed for running the instance.
By default, Payara Micro will create a folder in the system’s temporary directory and prepares a root configuration directory there. This makes instances' configuration stateless, but also has two potentially undesirable effects:
Temporary directory may be deleted by system cleanup procedure. It is therefore important not to use a temporary directory in production scenarios. If files are removed by a third party process, the application will not behave correctly anymore.
Preparing the directory has an impact on startup time
Root configuration directory can be explicitly specified with the command line parameter --rootDir <directory>
. In such case, the directory is created only once, and instance configuration is preserved across restarts of the instance.
Following configuration is preserved:
Deployed applications
Effects of preboot, postboot and postdeploy commands
Logging configuration
This section covers how to use Payara Micro.
Payara Micro is an embedded release of Payara built from the Payara Embedded Web release. It allows you to deploy and run WAR files from the command line with a single command, and also features automatic, dynamic clustering with Hazelcast.
Any commands listed will be written assuming they are being run from the same directory as the Payara Micro JAR file.
Any commands listed will also be written assuming that the system environment variables have been set up to have Java on the system Path.
Any paths listed throughout the documentation will use the Unix/Linux file path structure (forward slashes).
The owning class of an API method will not be explicitly stated unless it is not clear if an instance has been started or not; methods that operate on Payara Micro instances before they have been bootstrapped (instances that have not yet been started) are contained in the PayaraMicro
class, whereas methods that operate on bootstrapped instances (running instances) are contained within the PayaraMicroRuntime
class.