+

Search Tips   |   Advanced Search

featureManager command

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

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


Syntax

Syntax:

where action can take one of the following values:

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 us to compile build scripts against the API JARs 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, we must not move the output JAR to another directory.

The --features option must be specified with this action.

install

Install a feature from an enterprise subsystem archive (ESA) file. This action uses the OSGI-INF/SUBSYSTEM.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 featureManager command can download assets from the Liberty Repository; for more information, see Install Liberty Repository assets.

featureList

Generate an XML file containing a report that details all the features installed.

find

Generate a list of all assets in the Liberty Repository, find assets in the Liberty Repository applicable to the configuration, or view detailed information.

help

Display help information for a specified action.


Options

The following options are available for the featureManager classpath command:

--features=feature1,feature2,...

The list of features containing the list of API JAR files. Required for the classpath action.

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.

We cannot use this option if we 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 we can install features. When used with the --downloadOnly option, this option specifies a destination directory for downloaded features. Required when using the --downloadOnly and --offlineOnly options.

We cannot use this option if we specify the subsystem archive location with a file name or URL.

--offlineOnly

Use this option if we 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.

We cannot use this option if we 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 to install the feature. We can install the feature to any configured product extension location.

--viewLicenseAgreement

View license agreement.

--viewLicenseInfo

View license information.

--when-file-exists=exist_option

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.

subsystem_archive

Location of the subsystem archive to install. We can specify the location in the following ways:

  • A file name, such as my_feature.esa, or URL, such as http://myhost.ibm.com/liberty/assets/my_feature.esa 

  • 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

See the Downloads page on WASdev.net.

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

Name of the XML report file to create.

The following options are available for the featureManager find command:

searchString

Generates a list of Liberty Repository assets applicable to the configuration.

--viewInfo

Displays detailed information.


Usage examples

The following example installs the subsystem archive my_feature.esa as a user feature:

The following example installs the subsystem archive my_feature.esa to the my_extension product extension location:

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:

The following example generates a report containing all installed features defined in the product extension 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:

The following example generates a report containing all features defined in the product extension 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:

The following example displays help information for the install action:

The following example finds assets applicable to the configuration:

The following example lists detailed information:

The following example downloads required dependencies from the Liberty Repository to a local directory and does not install them:

The following example downloads all dependencies from the Liberty Repository and does not install them:

The following example installs features that are located in a local directory. If there are missing dependencies, they are installed from the online repository:

The following example installs assets from a local directory without downloading missing dependencies from the Liberty Repository:

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

featureManager featureList --features=servlet-3.0 classpath.jar
javac -cp classpath.jar TestServlet.java

Return codes

Return code Explanation
0 The command successfully completed the requested operation.
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 we 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 containing the feature files does not exist.

24 The .esa subsystem archive file is missing content.
25 A file we 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.


Parent topic: Administer the Liberty profile from the command prompt