Chapter 3. Application deployment in CodeReady Studio

In order to deploy applications to a server from within CodeReady Studio 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 CodeReady Studio using Runtime Detection. 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

  1. Start CodeReady Studio.
  2. Click WindowPreferences.

    crs preferences

    The Preferences window appears.

    crs jboss runtime detection
  3. Enter JBoss in the search field.
  4. Select JBoss Runtime Detection.
  5. Click Add.
  6. Locate the directory containing the runtime server.
  7. Click Open.

    The Searching for runtimes window appears.

    crs searching for runtimes
  8. Click OK.
  9. Select the path to the runtime server directory.

    crs select path to runtime server
  10. Click Apply and Close.

3.2. Configuring a remote server

The following section describes how to configure a remote server in CodeReady Studio.

Procedure

  1. Start CodeReady Studio.
  2. Press Ctrl+N.

    The Select a wizard window appears.

    crs select wizard server
  3. Enter Server in the search field.
  4. Select Server.
  5. Click Next.

    The Define a New Server window appears.

    crs select the server type
  6. Select a server type.
  7. Click Next.

    The Create a new Server Adapter window appears.

    crs create a new server adapter
  8. Select the Remote check box.
  9. Select a Controlled by option.
  10. Select the Server lifecycle externally managed check box.
  11. Select the Assign a runtime to the server check box.
  12. Click Next.

    The JBoss Runtime window appears.

    crs runtime server window
  13. Click Browse in the Home Directory field to locate the runtime server.
  14. Click Next.

    The Remote System Integration window appears.

    crs remote system integration window
  15. Click Browse in the Remote Server Home field.

    The Browse remote system window appears.

    crs browse remote server
  16. Specify the path to the directory that contains the remote server.
  17. Click Finish.

3.3. Deploying an application

After configuring the local server, you can deploy applications to the server from CodeReady Studio using the server adapter. The server adapter enables runtime communication between the server and CodeReady Studio for easy deployment of applications and server management.

The following section describes how to deploy an application to the server in CodeReady Studio.

Procedure

  1. Start CodeReady Studio.
  2. Right-click your projectRun asRun on Server.

    crs run on server

    The Run on Server window appears.

    crs run on server window
  3. Select the Choose an existing server check box.
  4. Select the server you want to deploy.
  5. Click Finish.

Your application opens in the internal CodeReady Studio web browser.