7.4 Publishing

The Virgo Server Editor includes a section to select when publishing to the server runtime should take place. The section offers three options:

immediate publish on resource change
publish after build
never publish automatically

Immediate publish means that a change to a file in a bundle project deployed on the Virgo Runtime Environment will be automatically published, triggering in most cases a re-deploy of the bundle project, as soon as the file is saved. Publish after build means that a change to one or more files will be automatically published, triggering in most cases a re-deploy, when the containing project is built, either because workspace auto-build is enabled or because the user requested a workspace or project build. Never publish automatically means that publishing will take place only on user request, via the "Publish" action on the Servers view.

While automatic publishing reduces the learning curve for beginners, it may also imply longer waits on large workspaces with many bundle projects deployed to a server, because the re-deploy of a project also implies the re-deploy of all dependent projects. On large workspaces it's recommend to turn off auto-publish and to manually publish bundles as needed. In fact, when the server is running in debug mode, if a source file is changed without altering the external "signature" of a class the Java Virtual Machine will be able to push the new byte-code to the server without requiring a re-deploy of the containing bundle and dependencies. In such case the developer can simply save and build and the Java Virtual Machine will perform the hot-code replace. When the source code change affects the "signature" of a class (such as a change in the signature of a method, a change in inheritance, the addition/removal of new properties of methods) the Java Virtual Machine won't be able to perform the hot-code replace and in such case the user can manually invoke the publish action to trigger a re-deploy of the involved bundle.