Add and remove Liberty features


Overview

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


Add or remove Liberty features

  1. Edit the following file with developer tools or with a text editor:

      /path/to/liberty/wlp/usr/servers/server_name/server.xml

    Optional: We can change the path.

  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.

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


Parent topic: Administer Liberty manually


Related information