Adding and removing Liberty features

Features are the units of functionality by which you control the pieces of the runtime environment that are loaded into a particular server. To add or remove a Liberty feature, you add or remove an XML snippet in the <feature> subelement of the server.xml configuration file. When you add or remove Liberty features, the changes are applied dynamically.

About this task

For a list of the main Liberty features, including the XML snippets that enable them, see Liberty features.

Procedure

To add or remove Liberty features, complete the following steps:

  1. Open the server.xml configuration file for editing.

    Where path_to_liberty is the location you installed Liberty on your operating system, and server_name is the name of your server.

    You can do this using a text editor. By default, the path and file name for the configuration root document file is path_to_liberty/wlp/usr/servers/server_name/server.xml. However, you can change the path. See Customizing the Liberty environment.

  2. Add or remove features in the configuration file.
    The set of features is enclosed within the <featureManager> element, and each feature within the <feature> subelement. For example:
    <server>
      <featureManager>
        <feature>servlet-3.0</feature>
        <feature>localConnector-1.0</feature>
      </featureManager>
    </server>
    The matching of feature names is not case-sensitive; the following example is also a valid server configuration:
    <featureManager>
            <feature>Servlet-3.0</feature>
            <feature>localConnector-1.0</feature>
    </featureManager>
  3. Save the changes to the configuration file.

Results

Your changes are applied. If the server is running, the changes are applied dynamically.