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
<feature> subelement of the server.xml configuration
file. When you add or remove Liberty
features, the changes are applied dynamically.
Before you begin
You can add and remove Liberty features as described in this topic, or as described in Editing the Liberty configuration by using developer tools.
About this task
For a list of the main Liberty features, including the XML snippets that enable them, see Liberty features.
To add or remove Liberty features, complete the following steps:
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.
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:
The matching of feature names is not case-sensitive; the following example is also a valid server configuration:
<server> <featureManager> <feature>servlet-3.0</feature> <feature>localConnector-1.0</feature> </featureManager> </server>
<featureManager> <feature>Servlet-3.0</feature> <feature>localConnector-1.0</feature> </featureManager>
- Save the changes to the configuration file.