Payara Server tools in VSCode
Open the command pallet using Ctrl + Shift + P, type Payara and select the Add Payara Server option:
Or In the explorer sidebar (or Payara activity bar), expand Payara Servers, Press the + sign to add Payara Server:
Browse the Payara Server installation path (recently used servers location are listed by default):
Choose a name for the server.
Then select a domain from the list or create a new domain by pressing the + button:
That’s how to add Payara Server to VSCode.
Once Payara Server is added to VSCode it can be found under the Payara Servers explorer panel with the configured name. Right-clicking on the server lets you do the following things:
Start, restart or stop the server
Start debugging the server
Rename or remove the server
Open admin console
Open server log
Open server domain.xml config
Update Admin credentials
Update JDK Path
An application can be deployed and undeployed easily from VSCode.
Right-click on the application and select Run on Payara Server to deploy the application:
Alternatively, an application can be deployed from Java Projects interface:
The deployed application can be opened in the browser, undeployed or disabled by right-clicking on the application:
The Auto Deploy and Hot Deploy mode are helpful for developers to run and test an application immediately after making changes to its sources without restarting the Server or manual redeployment to maximize your productivity.
Payara Server provides the Hot Deployment capability, which boosts the performance of the application redeployment operation and dynamically replaces the classloader of the application on each redeployment in the hot deploy mode.
The Hot Deploy mode can be enabled in Visual Studio Code from the Deployment Settings of Payara Server.
|The Hot Deploy feature is in technical preview.|
After enabling the Hot Deploy settings as mentioned above, simply deploy web applications to Payara Server and modify any Java class of the application to perform the auto redeploy of application on save . You’ll observe that redeployment of the application in Payara Server is faster than vanilla redeployment and console log will confirm that the hot redeployment happened.
By enabling the Auto Deploy feature, you may automate the manual deployment processes to boost the developers productivity. It will undeploy the existing application and redeploy the new application on every save action so developers can focus on the key development task. Auto Deploy feature full redeploys an application and therefore is slower than hot redpeloy, which redeploys only the changed part of an application.