In this chapter it will be described how to deploy modules onto the server.
First of all it is necessary to say that deploying to a server is mostly painless. There are several ways to do it provided by WTP, and some additional methods provided by JBoss Tools. These methods are described further in this chapter.
On the package explorer it is possible to publish either a project to a server or just a signal file. Let's look at how to do this.
The first WTP method is to right-click on a project, such as a Dynamic Web project, EJB project, or EAR project and then select Run As > Run on Server . The resulting dialog allows you to select which supporting server the project can be published to.
Click Next button to see add or remove projects page where you can choose projects to configure them on server.
This page of the wizard also allows to undeploy modules from the server. For that choose proper module(s) from the right and click < Remove . The modules will be completely undeployed after restarting your server or republishing.
Generally, for the JBoss AS Server Adapters, publishing using this method will force a default, best-guess, packaging configuration for your project. This best-guess does not publish incrementally, but instead repackages your entire project into a .war , .jar , or .ear as appropriate, and then copies that file into the proper deploy directory. For quicker smarter deployment, you will need to create archives using the Project Archives view and customize packaging yourself.
Sometimes it becomes necessary to deploy one or more files to a server. For that in order not to do a full republish in the context menu of files a Deploy To Server option is provided that allows a single file deployment. To deploy these non-WTP files/projects right click on the file ( -ds.xml, .ear, .jar etc.) and select Deploy To Server and it will be automatically deployed.
The deployed files are listed side-by-side with other modules that are deployed to the server.
As it has been already mentioned JBoss Server View contains two parts: the top part that displays all defined servers and the bottom part which provides categories with additional information. Thus, in this section we suggest two more ways to deploy resources onto the server.
In the top part of the JBoss Servers View like in the Servers View you should right click on a server and select the Add and Remove Projects menu item.
This will bring up a familiar dialog allowing you to either publish projects or modules to a server, or remove them from the server. If the selected module is a project like a Dynamic Web project, EJB project, or EAR project, it will be published as through Run on Server wizard, with a best-guess full package. If, however, the selected element is an archive from the Project Archives view, it will be published according to the rules of that module type.
In the bottom part of JBoss Server View there is a category called Modules which should display all currently-published modules on the server. Right-clicking on the desired module and selecting Full Publish will force a full rebuild of the entire module.
Here, Incremental Publish is meant to enable publishing of only those parts where changes have been made.
In the Project Archives View you can right-click on any declared archive and select the Publish To Server element. For more on this subject, see Publishing to Server in the Project Archives View section.
The only way to ensure an Incremental Build , such as changes to one .jsp, .html, or .class file, is to enable the builder for that project. This is done by either changing the global preferences for the Archives View, or by enabling project-specific preferences and ensuring the builder is on.
The last chapter covers a variety of methods on how you can deploy needed modules onto a server.