Liberty: featureManager command

Use the featureManager command to install a feature and to obtain details of all the features that are installed.

The feature that you want to install must be packaged as a subsystem archive (ESA file).

You can access the Liberty Repository using the featureManager command through a proxy server. For more information, see Configuring proxy server support for the featureManager command in Liberty.

Important: The featureManager find, install, and uninstall actions are stabilized except when you install .esa files.

Use the installUtility command instead of the featureManager command. With the installUtility command, you can manage more asset types and install, find, or download assets from multiple repositories. For more information, see Installing assets using the installUtility command.

Syntax

The command syntax is as follows:

featureManager action [options]
where action can take one of the following values:
install
Stabilized feature: This action is stabilized. Use the installUtility install command unless you install .esa files. Use the featureManager command to install .esa files.
Install a feature or an enterprise subsystem archive (ESA) file to the runtime environment.
The featureManager command can download assets from the Liberty Repository. For more information, see Installing Liberty Repository assets.
uninstall
Stabilized feature: This action is stabilized. Use the installUtility uninstall command instead.
Uninstall features using either the feature short name or the feature symbolic name.
Note:
  • Ensure that all server processes are stopped before you uninstall a feature.
  • The uninstall action cannot uninstall user features; for example: webCacheMonitor-1.0.
featureList
Generate an XML file that contains a report that details all the features that are installed.
find
Stabilized feature: This action is stabilized. Use the installUtility find command instead.
Generate a list of all assets in the Liberty Repository, find assets in the Liberty Repository that are applicable to your configuration, or view detailed information.
classpath
Generate a JAR file that can be added to a compiler classpath in order to use APIs from a list of features. This action enables you to compile build scripts against the API JARs that are included in the product without referencing specific JAR names, which can change when a fixpack is applied. The output JAR contains relative paths to the API JARs in the product. Therefore, you must not move the output JAR to another directory.
Note: The --features option must be specified with this action.
help
Display help information for a specified action.

Options

The following options are available for the featureManager install command:
--acceptLicense
Automatically indicate acceptance of license terms and conditions.
--downloadOnly=[all | required* | none]
Download the requested feature to a local directory without installing the feature. This option can be configured to download all the dependent features, the dependent features required for this runtime, or none of the dependent features. The default is to download the required dependent features. Specify the directory with the --location option.
Note: You cannot use this option if you specify the subsystem archive location with a file name or URL.
--location=directoryPath
When installing a feature, this option specifies a local source directory from which you can install features. When used with the --downloadOnly option, this option specifies a destination directory for downloaded features. This option is required when using the --downloadOnly and --offlineOnly options.
Note: You cannot use this option if you specify the subsystem archive location with a file name or URL.
--offlineOnly
Use this option if you do not want to connect to the Liberty Repository. Instead, the command only installs features from the local directory. The local directory is specified with the --location option.
Note: You cannot use this option if you specify the subsystem archive location with a file name or URL.
--to=install_option
where install_option can take one of the following values:
  • usr: The feature is installed as a user feature. This is the default value.
  • extension: The location to which you want to install the feature. You can install the feature to any configured product extension location.
--viewLicenseAgreement
View the license agreement.
--viewLicenseInfo
View the license information.
--when-file-exists=exist_option
Specifies the action to take if a file to be installed already exists. exist_option can take one of the following values:
  • fail: Cancel the installation.
  • ignore: Continue the installation and ignore the file that exists.
  • replace: Overwrite the existing file.
--verbose
Use this option to display any available additional information while the action runs.
name
Specifies one or more features that you want to install, separated by a space or comma. You can specify the features in the following ways:
Feature IDs
  • Specify the short name of the feature, such as adminCenter-1.0
  • Specify the symbolic name of the feature, such as com.ibm.websphere.appserver.adminCenter-1.0
.esa file
  • Specify a file name, such as my_feature.esa
  • Specify a URL, such as http://myhost.ibm.com/liberty/assets/my_feature.esa

This action uses the OSGI-INF/SUBSYTEM.MF file from the ESA file as a new feature manifest that can be copied into the ${wlp.user.dir}/extensions/lib/features directory (or product extension directory if a value is specified for the --to property) being renamed after the symbolic name of the subsystem. All of the bundles for the subsystem will be extracted into the ${wlp.user.dir}/extensions/lib directory and renamed as {bundle symbolic name}_{bundle version}.jar. License files, checksum files, localization files, and other subsystem content will also be extracted to the location defined in the subsystem manifest.

The following options are available for the featureManager uninstall command:
--noPrompts
Uninstall features without any user interaction or confirmation messages.
--verbose
Use this option to display any available additional information while the action runs.
name
Specify one or more features to uninstall, separating the names by a space or comma. You can specify the following options:
  • The short name of the subsystem archive (ESA file), such as adminCenter-1.0.
  • The symbolic name of the subsystem archive (ESA file), such as com.ibm.websphere.appserver.adminCenter-1.0.
The following options are available for the featureManager featureList command:
--encoding=charset
where charset is the character set to use when creating the XML report file.
--locale=language
where language specifies the language to use when creating the XML report file. This consists of the ISO-639 two-letter lowercase language code, optionally followed by an underscore and the ISO-3166 uppercase two-letter country code.
--productExtension=name
where name is the product extension name whose features are to be listed. If the product extension is installed in the default user location, use the keyword: usr. If this option is not specified, the action is taken on WebSphere® Application Server Liberty Core.
XML_report_file_name
Specifies the name of the XML report file that you want to create.
--verbose
Use this option to display any available additional information while the action runs.
The following options are available for the featureManager find command:
--viewInfo
Displays detailed information.
--verbose
Use this option to display any available additional information while the action runs.
searchString
Generates a list of Liberty Repository assets that are applicable to your configuration.
The following options are available for the featureManager classpath command:
--features=feature1,feature2,...
The list of features that contain the list of API JAR files. This option is required for the classpath action.
fileName
The name of the generated JAR file.

Usage examples

The following example installs the subsystem archive my_feature.esa as a user feature:
featureManager install my_feature.esa --to=usr
The following example installs the subsystem archive my_feature.esa to the my_extension product extension location:
featureManager install my_feature.esa --to=my_extension
The following example generates a report for all installed features; the report is written to the file my_feature_report.xml using the Brazilian Portuguese language:
featureManager featureList my_feature_report.xml --locale=pt_BR
The following example generates a report that contains all installed features that are defined in the product extension that is installed in the default user location wlp/usr/extension, which is known by the runtime environment as the usr product extension. The report is written to the file my_feature_report.xml:
featureManager featureList --productExtension=usr my_feature_report.xml
The following example generates a report that contains all features that are defined in the product extension that is installed in the location pointed to by the content in the productExtensionName.properties file in the product installation's etc/extensions directory. The report is written to the file my_feature_report.xml:
featureManager featureList --productExtension=productExtensionName my_feature_report.xml
The following example displays help information for the install action:
featureManager help install
The following example installs a feature and includes additional information:
featureManager install extendedPackage-1.0 --verbose
The following example finds assets that are applicable to your configuration:
featureManager find searchString
The following example lists detailed information:
featureManager find searchstring --viewInfo
The following example finds a feature and includes additional information:
featureManager find "adminCenter-1.0" --verbose
The following example downloads required dependencies from the Liberty Repository to a local directory and does not install them:
featureManager install feature_shortName --downloadOnly --location=c:\temp\download --acceptLicense
The following example downloads all dependencies from the Liberty Repository:
featureManager install feature_shortName --downloadOnly=all --location=c:\temp\download --acceptLicense
The following example installs features that are located in a local directory. If there are missing dependencies, they are installed from the Liberty Repository:
featureManager install feature_shortName --location=c:\temp\download --acceptLicense
The following example installs assets from a local directory without downloading missing dependencies from the Liberty Repository:
featureManager install feature_shortName --location=c:\temp\download --offlineOnly

The following example creates a classpath JAR file and compiles an application class that uses it:

featureManager classpath --features=servlet-3.0 classpath.jar
javac -cp classpath.jar TestServlet.java
The following example uninstalls a feature:
featureManager uninstall adminCenter-1.0

Return codes

Table 1. Return codes and explanations
Return code Explanation
0 The command successfully completed the requested operation.
20 One or more arguments are not valid.
21 A runtime exception occurred because of one or more of the following conditions:
  • A runtime exception occurred while installing the .esa subsystem archive file.
  • A license is not accepted or acknowledged.
  • The .esa subsystem archive file did not extract correctly.
22 The feature that you wanted to install already exists.
23 The feature definition was not valid for one or more of the following reasons:
  • The feature does not have a valid manifest file.
  • The version of the feature is not supported in this Liberty environment.
  • The .zip or .jar file that contains the feature files does not exist.
24 The .esa subsystem archive file is missing content.
25 A file that you wanted to install already exists, and you specified the when-file-exists=fail option.
26 The product is not a core product, and the product extension files cannot be found.
27 The product is not a core product, and the product extension is not defined in the ${wlp.install.dir}/etc/extensions/extension_name.properties file.
28 The manifest files for the feature in the product extension cannot be found.
29 The feature is not valid for the current product.
36 Installation of a user feature is invalid for the extension specified: --to=core .