Chapter 3. Application deployment in CodeReady Studio
In order to deploy applications to a server from within the IDE you must configure the IDE with information about the server. For a local server this information includes the following:
- A server runtime environment with details about the server location, runtime JRE, and configuration files
- A server adapter with management settings for the server runtime environment, including access parameters, launch arguments, and publishing options
JBoss Server Tools enables you to efficiently configure a local server ready for use with the IDE using Runtime Detection. As demonstrated here, this feature is useful for quickly configuring a server for deploying and testing an application.
3.1. Configuring a local server
Runtime Detection searches a given local system path to locate certain types of runtime servers. For any servers found, Runtime Detection automatically generates both a default server runtime environment and a default server adapter. These items can be used for immediate application deployment as is or they can be customized to meet your requirements.
The following section describes how to configure a local server in CodeReady Studio.
Procedure
- Start CodeReady Studio.
Click Window → Preferences.
The Preferences window appears.
- Enter JBoss in the search field.
- Select JBoss Runtime Detection.
- Click the Add button.
- Locate the directory containing the runtime server.
Click Open.
The Searching for runtimes window appears.
- Click OK.
Select the path to the runtime server directory check box.
- Click Apply and Close.
3.2. Configuring a remote server
The following section describes how to configure a remote server in CodeReady Studio.
Procedure
- Start CodeReady Studio.
Press Ctrl+N.
The Select a wizard window appears.
- Enter Server in the search field.
- Select Server.
Click the Next button.
The Define a New Server window appears.
- Select the appropriate server type.
Click Next.
The Create a new Server Adapter window appears.
- Select the Remote check box.
- Select the appropriate Controlled by option.
- Select the Server lifecycle externally managed check box.
- Select the Assign a runtime to the server check box.
Click Next.
The JBoss Runtime window appears.
- Click Browse in the Home Directory field to locate the runtime server.
Click Next.
The Remote System Integration window appears.
Click Browse in the Remote Server Home field.
The Browse remote system window appears.
- Specify the path to the directory that contains the remote server.
- Click Finish.
3.3. Deploying an application
After configuring the local server, you can deploy applications to the server from the IDE using the server adapter. The server adapter enables runtime communication between the server and the IDE for easy deployment of applications and server management.
The following section describes how to deploy an application to the server in CodeReady Studio.
Procedure
- Start CodeReady Studio.
Right-click your project → Run as → Run on Server.
The Run on Server window appears.
- Select the Choose an existing server check box.
- Select the server for deployment.
- Click Finish.
Your application opens in the internal CodeReady Studio web browser.