featureUtility installFeature
The featureUtility installFeature
command installs a single feature or a list of space-separated features. You can use the featureUtility installFeature
command to install features into Open Liberty from Maven Central, or from a Maven repository that’s hosted inside your firewall.
You can modify the behavior of the featureUtility installFeature
command by declaring environment variables in the shell environment or by specifying properties in the featureUtility.properties
file that’s located in the {wlp.install.dir}/etc/
directory. For example, you can define a local Maven repository to override Maven central when you install a feature. For more information, see Modifications for featureUtility commands.
Usage examples
Install the MicroProfile Health 2.2 feature from Maven Central:
featureUtility installFeature mpHealth-2.2
Install the MicroProfile Health 2.2 feature without caching the feature to the local Maven repository:
featureUtility installFeature mpHealth-2.2 --noCache
Install the userFeature-1.0
custom user feature from a Maven repository:
featureUtility installFeature userFeature-1.0 --featuresBom=my.user.features:myBOM:<runtime-version>
In this example, the <runtime-version>
value is the version of the Open Liberty server where you want to install the feature, for example, 21.0.0.11
.
Syntax
Run the command from the path_to_liberty/wlp/bin
directory.
featureUtility installFeature featureName [options]
- featureName
The name of the feature or features that you want to install. You can include one or more space-separated features by specifying the feature shortname or the Maven coordinates. If you specify the Maven coordinates, it must contain the group ID and the artifact ID, for example,
io.openliberty.features:mpHealth-2.2
. If the version and packaging type aren’t specified, the version defaults to the current runtime version and the packaging type defaults to an ESA file.
Options
Option | Description |
---|---|
--acceptLicense | Accepts the license agreement for the feature if the feature has a different license from the Open Liberty server into which it’s installed. |
--featuresBom | Specifies the Maven coordinates for a features BOM file. Use this option to install custom user features from a Maven repository. Ensure that the repository also contains the associated features JSON file in the same group ID as the BOM. |
--noCache | Specifies that features that are installed from a remote repository, such as Maven Central, aren’t cached locally. |
--verbose | Displays additional debug information while the action runs. |
--to | Specify the extension location to install user features. If this option is not specified, the feature is installed to default |
Exit codes
The following exit codes are available for the featureUtility installFeature
command:
Code | Explanation |
---|---|
0 | OK. 0 indicates successful completion of the requested operation. |
20 | 20 indicates that one or more arguments are not valid. |
21 | 21 indicates that a runtime exception occurred because of one or more of the following conditions: - A runtime exception occurred during the installation of the |
22 | 22 indicates that feature to be installed already exists. |
23 | 23 indicates that 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 Open Liberty environment. - The |
24 | 24 indicates that the |
25 | 25 indicates that an I/O exception occurred during the installation of the |
29 | 29 indicates that the feature is not valid for the current product. |
33 | 33 indicates that the connection to the repository failed. |