Hot Deploy Feature in Payara Platform 5.201

Uncategorized

Being productive gives developers a sense of satisfaction and fulfillment. That’s why increasing developer productivity is always our priority and we are consistently working towards improving the Payara Platform developer tools and the developer experience.

In this blog, we will show you how to configure a Project in the Apache NetBeans IDE to enable Auto Deploy and Hot Deploy mode.

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 where Auto Deploy is the feature of Apache NetBeans IDE and Hot Deploy is the feature of Payara Server. Hot Deploy mode is currently only supported in Apache NetBeans IDE as an experimental feature.

Auto Deploy

By enabling the Auto Deploy feature of Apache NetBeans IDE, 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.

Compile on Save:

The NetBeans IDE instantly compiles modified sources when you save them. 

Deploy on Save:

The NetBeans IDE instantly redeploys running application when a change is made to the project. 

Hot Deploy

Payara Server allows IDEs to deploy the application in Hot Deploy mode by reusing the existing application instance and updating its classloader & internal components relative to the modified source. This can lead to significant savings of time when an application is redeployed and boost developer productivity even more.

How to Configure the Hot Deploy Feature

If you don’t have a project in Netbeans set up yet, first follow the steps in theAdding Payara Server to NetBeansblog to learn about setting up Payara Server and a project in the Apache NetBeans IDE for running your web apps. Make sure that you use Netbeans 11.3 or newer to use the Hot Deploy functionality.

If you already have a project in Netbeans 11.3 or newer set up and ready to deploy to the Payara Server, you can continue with adjusting the configuration of the Auto Deploy and Hot Deploy mode.

Go to Properties on your project and then the Compile section of this window to enable the Compile On Save feature.

Compile-on-saveand the Run section of this window to enable the Deploy On Save feature.

Deploy-on-save

Once Auto Deploy mode is configured in the project, go to Services tab > Servers > Payara Server > Properties > enable the Hot Deploy option.

Hot-deploy

That’s it! Now the Hot Deploy mode is enabled, and you don’t have to restart or redeploy manually after each and every change. 

Hot Deploy in Action

See the following screencast to compare the application redeployment time in the both Vanilla and Hot deploy mode:Payara-Server-HotDeploy

After enabling the Hot Deploy mode, redeployment process is optimized except the first redeploy task which saves the application state.

What’s Next?

Hot Deploy mode is the technical preview feature and currently optimizes the core deployment components and web components of the Payara Platform. In the future release, other components of the Payara Platform will be forged to support Hot Deploy mode which will lead to tremendous improvement and saving of time in redeployment tasks.

Increasing developer productivity and development speed is definitely a worthwhile investment. If you are more productive, you can achieve more in less time and make the best possible use of your time.

Learn More:

{{cta(‘634916ab-b1cc-4e73-8e42-63230adb7f7c’)}}

Download and Try the Payara Platform:

{{cta(‘b2e4c2b6-f33a-4ae4-9290-f1cf476f445a’)}}

Comments (12)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

  1. Nikolas Christou

    There are no words to describe how much I wanted this feature of Payara especially for Netbeans IDE. Definitely a time saver !!!

  2. Robert

    Hello.

    I sounds like a great feature, 🙂

    I have two questions related to it if you have time:

    1. What’s the difference between the “hot deploy” and deploying exploded war and then reloading it by “touching” .reload file?

    2. How can I use “hot deploy” if I don’t want to use NetBeans and write my own scripts instead? Are there any new arguments to asadmin or something like that?

    Thanks in advance for reply,

  3. Gaurav Gupta

    Hi Robert,

    By creating/updating a .reload file in the root directory of the exploded war will automatically redeploy the application by undeploying the existing application, deploys the new application without any optimization in the deployment process.

    Technical insight of the Hot Deploy feature is already mentioned in the blog as this feature updates the existing classloader, reuses the existing application state and optimizes the deployment process.
    The “hot deploy” feature is enabled by passing the ‘–hotDeploy’ option in deploy command. And on the consecutive redeployment operation modified source info is also passed to server using ‘–sourcesChanged’ option.

    e.g:
    asadmin deploy –hotDeploy=true sample_app.war
    asadmin redeploy –name=sample_app –hotDeploy=true –sourcesChanged=org.payara.sample.HelloWorld,a.b.c.MyClass sample_app.war

    This feature is designed for integration with IDE and advanced editors, Currently integrated with the Apache NetBeans IDE. Which IDE do you use for developing the application?

  4. Robert

    Hello Guarav and thank you for reply!

    I use IntelliJ IDEA on Windows.

    And I’m quite happy with .reload apart from one thing:
    I works very well when .class files directly inside war are changed. But, I cannot reload a jar inside war if I change something in that jar – I need to rebuild and do “full” redeploy. Somehow Windows or Payara process locks the jar file and it cannot be overwritten.

    I hope that –sourcesChanged argument can contain classes inside jars in war. Can it?

    For small changes I use DCEVM, attach debugger and use “hot swap” in IDE but sometimes it’s not enough.

  5. Gaurav Gupta

    Hi Robert,

    Thanks for sharing the details, we are working on Payara IntelliJ IDEA plugin so hot deploy feature in IntelliJ will be available in the upcoming months.
    The ‘–sourceChanged’ option support classes inside the jar in the war but due to locking issue in windows, it is not supported yet.

  6. Peter

    Hi Gaurav,

    thanks for the post, the “hot deploy” is an excellent feature.

    However, I am using docker images to run payara server and so within NetBeans it is treated as a remote domain and the hot deploy feature is not available.

    Is there any workaround you might be aware of so the feature works when using containers? Such as bind mounting certain folders…

  7. Gaurav Gupta

    Hi Peter,

    Yes, you are right Hot Deploy feature is not available for the Remote domain due to the fact that Hot Deploy feature only works with exploded war artifacts.
    But it will great addition to the Payara Platform tooling, I have created internal ticket FISH-511 to address it.

  8. Alfonso Maestre

    Hi!
    what happend with this feature in 12.1?
    There is not this option to “Deploy on save” and the “Compile on save” is always disabled.
    Is it because of using gradle instead of maven?
    The “hot deploy” is avaliable at the Payara server properties, but no clue about the previous ones 🙁

    Thank youj.

  9. Gaurav Gupta

    Hi Alfonso,

    You are right, I request you to create the ticket here https://issues.apache.org/jira/projects/NETBEANS/issues and/or ask for help in the Apache NetBeans mailing list users@netbeans.apache.org as this is an issue with Gradle modules of IDE.

  10. Mark

    Hi Gaurav,

    thanks for the great hot-deploy feature. Any news on when this will be supported in the IntelliJ Payara Plugin? I have the current version 1.3.1, but cannot find any configuration options for hot deployment.

    Thanks

  11. Gaurav Gupta

    Hi Mark,
    Currently, only Apache NetBeans IDE and VSCode support the hot deploy feature. The Hot Deploy feature for both the Payara Server and Payara Micro is planned to be supported in Intellij IDEA and Eclipse IDE by the end of this year.

  12. Rhume Disi

    Thank you very much for this blog post. I have activated the Auto deploy and Hot Deploy in Netbeans and Payara. I can enjoy some productivity gains.

Related Posts

4 minutes
Uncategorized

Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified

We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]

Understanding the Security Issues of Aging Middleware 8 minutes
Security

Understanding the Security Issues of Aging Middleware

Middleware runs quietly in the background of most applications, which makes it easy to overlook its lifecycle. In effect, […]

New Releases 5 minutes
News

What’s New In The Payara Platform September 2025 Release?

The September 2025 release marks a significant milestone with Payara 7.2025.1.Beta1 advancing Jakarta EE 11 readiness, alongside focused improvements […]