How Deploy on Save works



The Deploy on Save (DoS) feature is designed to make the "save / compile / run" cycle faster also for Web based project's run on application server. It's a supplementary feature to Compile on Save (CoS) and it's actually not possible to have DoS activated while CoS is disabled. This can be helpful for users accustomed to running and testing an application immediately after making changes to its sources. It utilizes *.class files produced while updating the internal data about projects. These files are always up to date, so there is no need to redeploy the application to regenerate them again after some change is made.

Copy on Save for static resources

Beside DoS, there is one more additional feature since NetBeans 8.0 called Copy on Save for static resources (CoSsr). This had been created because a lot of people were asking for possibility not to update Java files automatically while still having their static pages (jsp, html, xhtml etc.) refreshed automatically.

What options do you have

There are basically four reasonable options you have when developing Maven Web applications.

1/ Do not use neither DoS nor CoSsr. You will need to take care of data that are on the application server and rebuild/redeploy your application whenever you will need to see your latest file changes.

2/ Use only CoSsr. You will need to take care of your Java files, but you don't need to care about static resources. It means you can safely change for example html files and you will see the changes immediately but you still have to rebuild/redeploy your application whenever you want to see updated Java files.

3/ Use only DoS. Opposite situation to point 2. You don't need to take care of Java files, but you still need to take care of static resources.

4/ Use both DoS and CoSsr. You don't need to take care of anything. Simply change your files, they will get updated on the application server and you should see the changes immediately.

More notes

Please be aware that for Web application it make no sense to use CoS without DoS. CoS works the same as in case of J2SE project's, but because the changes are not propagated to the application server, you won't be able to see any change in your browser. So when I'm speaking here about activated DoS, it always means to have active both CoS and DoS. But when I'm speaking about deactivated DoS, it means DoS is not active, BUT it doesn't matter if CoS is activated or not.

See more details about Compile on Save

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo