Creating a Liberty server and a project

You can create a Liberty server, and then choose an OSGi project, an Enterprise JavaBeans (EJB) project, or a web project as the target project.

Before you begin

If you plan to create a web service that uses WebSphere® Application Server Liberty, the server must be installed and created before you begin creating your web service.

Procedure

  • Create a server in the workspace.
    1. Select File > New > Other > Server > Server > Next.
    2. Expand IBM and select WebSphere Application Server Liberty as the server type.

      Ensure that you select the correct version of the server for your installation.

    3. Click Next.
    4. See the Creating a Liberty server by using developer tools task to complete the New Server wizard.
    5. Click Finish.

      You created a server in the workspace. To view the server, you can select Window > Show view > Other > Server > Servers > OK.

  • To create a web project, an OSGi project, or an EJB project that points to the Liberty server that you created, complete the following steps:
    1. Create the project.
      • To create a web project, select New > Web > Web Project.
      • To create an OSGi project, select New > Web > Web Project.
      • To create an EJB project, select New > EJB project
    2. Project Name: enter a project name.
    3. Target runtime environment: select WebSphere Application Server Liberty that you installed. If it is not listed, click New and browse to the location where it is installed.
    4. Configuration: Accept the default configuration for your server, or click Modify to change the project facets.
    5. For a web project, ensure that Add project to an EAR is selected.

      The New Project wizard generates the EAR file.

    6. For an OSGi project, complete the following steps.
      1. Click the OSGi programming model for an OSGi project.
      2. In the Application field, click Add to Application; clear this field if you do not want to associate the OSGi bundle with an OSGi application.

        The New Project wizard generates the OSGi application.

    7. For an EJB project, ensure that Add project to an EAR is selected.

      The New Project wizard generates the EAR file.

    8. Click Finish.
    9. To associate the project with the server, right-click the WebSphere Application Server Liberty server that you created in the Servers view and select Add and remove projects. Select the service and client projects from the Available projects list and click Add.
    10. Start the server by right-clicking it and selecting Start.