Applications can be deployed to Payara Server in the same way as GlassFish Server 4.1 Open Source Edition. Payara Server does not modify this process but does add some new features to deployment descriptor files which are documented in the following pages.
Deploying On Server Start
GlassFish has had the ability to deploy applications on server start for a long
time now, using the autodeploy directory. While acceptable in development
environments, the scanner used to deploy files in this directory is a security
risk for production and is therefore disabled in the
payaradomain bundled with
To reintroduce the capability of deploying an application on server startup without the risk of enabling the deployment scanner, a feature from Payara Micro was introduced: the ability to run asadmin commands at startup, either pre or post boot.
To enable this feature, we have extended the
start-domain feature to accept
two extra options:
--postbootcommandfile which can
be used as follows:
- Pre-boot Commands
asadmin> start-domain --prebootcommandfile=/path/to/file
Aim: passing a list of commands as a file to the server to run pre-boot. Due to the time during boot when the commands in this file are executed, this only supports
- Post-boot Commands
asadmin> start-domain --postbootcommandfile=/path/to/file
Aim: passing a list of commands as a file to the server to run post-boot. This is where commands such as service configuration commands should be run.
There are some important caveats to note: