Publishing your application

Publishing involves copying files (projects, resource files, and server configurations) to the correct location for the server to find and use them. In the test environments, these files may already be in the correct location. In some cases, temporary copies of the server configurations may be created. You can either publish your application automatically or manually.

About this task

Automatically publishing to a server

If the Automatically publish when starting servers check box on the Server preferences page (Window > Preferences > Server > Launching) is selected, the workbench checks to see if your project and files on the server are synchronized. If they are not, the project and the files are automatically updated when the server is either started or restarted.

In the workbench, you have several options to choose for the Publishing settings. You can set these Publishing settings by going into the Servers view, right-click the server and select Open. The Server editor opens. In the Overview page of the server editor, under the Publishing settings, you are going to find the following settings:
  • Never publish automatically: Specifies the workbench should never publish files to the server.
  • Automatically publish when resources change: Specifies the workbench to issue a publish after changes on a file that is associated to the server are saved and a full time interval has passed in the Publishing interval setting.
  • Automatically publish after a build event: Specifies the workbench to issue a publish after changes on a file that requires a build and is associated to the server are saved, and a full time interval has passed in the Publishing interval setting.
  • Publishing interval (in seconds): Specifies the number of seconds that needs to pass before the workbench calls a publish to happen on the server. However, if you make a subsequent change to the files before this time interval has completed, the publish is delayed as the timer is reset. The workbench makes a publish to the server only after the full time interval has passed. If you set the publishing interval to 0 seconds, an immediate publish should happen after changes on a file are saved.

In the workbench, the default setting is the Automatically publish when resources change option is enabled with a value set in the publishing interval.

In addition, under the Select publishing actions list, select the tasks you want to run during publishing:
  • For WebSphere® Application Server, there is a Deploy J2EE Modules check box enabled by default. This check box specifies to generate deployment code for J2EE modules at 1.4 (or earlier) specification-level. If you are publishing a J2EE module that contains a Web Service or enterprise bean and this check box is enabled, the workbench is going to generate the deployment code for these artifacts.
Manually publishing to a server

If you do not want to wait for the automatic publishing interval to pass, at anytime you can manually request the workbench to issue a publish command to the server. Each manual publish command causes a single publishing request to the server. To publish your application manually you can complete one of the following in the Servers view:

For the Tomcat local server, J2EE publishing server and Static Web publishing server environments, clicking Publish to the server icon transfers publishable files outside the workbench. When publishing to one of these servers, you can select one of the following publishing method:
  • Local copy to copy resources directly from one machine to another in the file system. This option is supported for Tomcat servers.
  • FTP file transfer to copy resources from one machine to another using File Transfer Protocol (FTP). This option is supported for J2EE Publishing Server or Static Web Publishing server.

For a remote WebSphere Application Server, the Agent Controller is no longer required. There is a WebSphere File Transfer servlet application, filetransfer.ear file, available in the WebSphere Application Server V6.1 or later. The WebSphere File Transfer servlet application handles the publishing method automatically. If you are running a remote or local secured WebSphere Application Server V6.1 with the Run server with resources on Server publishing option, you need to run the redeployFileTransfer.jacl script. This script switches to the secured version of the WebSphere File Transfer servlet application, filetransferSecured.ear. To run this redeployFileTransfer.jacl script complete the steps in the following Publishing fails and console output does not display to a secured WebSphere Application Server v6.x topic. For WebSphere Application Server V7.0 or later, you no longer need to run the redeployFileTransfer.jacl script as this step is automated.

All the projects defined in the server configuration that are associated with the selected server are published. The resources in these projects are transferred to the location that is defined by the server.


Feedback