Skip to content

Commit

Permalink
Merge pull request #7453 from OpenLiberty/7427-versionless
Browse files Browse the repository at this point in the history
7427 versionless
  • Loading branch information
dmuelle authored Aug 7, 2024
2 parents 6e9552f + 29f7b0a commit c375040
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/reference/pages/feature/versionless-features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ Versionless features are available for the MicroProfile, Jakarta EE, and Java EE

== Enabling versionless features

To use versionless features, you must declare a corresponding versioned platform. You have three options to declare a platform:
To enable versionless features, you must declare a corresponding versioned platform. You have three options to declare a platform:

* <<platform, Specify a platform element inside the featureManager element of your server.xml file>>
* <<env, Specify the PREFFERED_PLATFORM_VERSIONS environment variable>>
* <<feat, Enable one versioned feature from a supported platform in your server.xml file>>
* <<feat, Enable a versioned feature from a supported platform in your server.xml file>>

[#platform]
=== Specify a platform element
=== Specify a platform element inside the featureManager element of your server.xml file

You can declare a platform version by specifying a `platform` element inside the `featureManager` element of your `server.xml` file. This method is simplest way to configure and keep track of your versionless features.
You can declare a platform version by specifying a `platform` element inside the `featureManager` element of your `server.xml` file. This method is the simplest way to configure and manage your versionless features.

For example, the following `server.xml` file configuration specifies a Jakarta EE platform of `jakartaee-9.1`, with associated versionless features for `servlet`, `persistence`, and `restfulWS`:

Expand Down Expand Up @@ -58,7 +58,7 @@ Similarly, the following example enables versionless MicroProfile features that
----

[#env]
=== Define platforms with an environment variable
=== Specify the PREFFERED_PLATFORM_VERSIONS environment variable

Alternatively, you can declare platforms for versionless features by defining the `PREFERRED_PLATFORM_VERSIONS` environment variable in your `server.env` file, as shown in the following example:

Expand All @@ -78,7 +78,7 @@ When this environment variable is set, you can specify versionless features in y
----

You can also set the `PREFERRED_PLATFORM_VERSIONS` environment variable from the environment shell. However, this method might cause problems if you need to package the server by running the xref:reference:command/server-package.adoc[server package] command.
When you set `PREFERRED_PLATFORM_VERSIONS` in the `server.env` file, the setting is retained by server packaging when you run the `server package` command. When the server image is unpacked, the `server.env` file still has the `PREFERRED_PLATFORM_VERSIONS` setting.
When you set `PREFERRED_PLATFORM_VERSIONS` in the `server.env` file, server packaging retains the setting is retained when you run the `server package` command. When the server image is unpacked, the `server.env` file still has the `PREFERRED_PLATFORM_VERSIONS` setting.

If you set the `PREFERRED_PLATFORM_VERSIONS` environment variable in the environment shell, the variable is not retained when the server is packaged. If this scenario occurs, the `server package` command issues the following warning:

Expand All @@ -89,9 +89,9 @@ CWWKE0969W: A manual PREFERRED_PLATFORM_VERSION environment variable was specifi
After you unpack the server image, you must provide a definition of the `PREFERRED_PLATFORM_VERSIONS` variable to the server.

[#feat]
=== Enable a versioned feature
=== Enable a versioned feature from a supported platform in your server.xml file

When you enable at least one versioned feature that is included in only one MicroProfile, Java EE, or Jakarta EE platform version, Open Liberty resolves any versionless features from that platform to their corresponding versions.
You can declare a platform implicitly by enabling at least one versioned feature that is included in only one supported platform version. Open Liberty then automatically resolves versionless features from that platform to their corresponding versions.

In the following `server.xml` example, the `mpHealth-3.0` feature is part of the MicroProfile 4.0 platform, and no other MicroProfile platform. Open Liberty automatically resolves the versionless `mpMetrics` and `mpConfig` features to the versions that are included in MicroProfile 4.0:

Expand All @@ -108,9 +108,9 @@ However, this strategy does not work if you declare a feature version that is pa

== Available platforms and versionless features

The following tables list the available MicroProfile, Jakarta EE, and Java EE platform versions and their corresponding versionless features. You can declare up to 2 platform elements, one for MicroProfile and another for either Jakarta EE or Java EE.
The following tables list the currently available MicroProfile, Jakarta EE, and Java EE platform versions and their corresponding versionless features. You can declare up to 2 platform elements, one for MicroProfile and another for either Jakarta EE or Java EE.

Features that are not specifically included in the supported platforms are not available in versionless format.
Only features that are included in the supported platforms are available in versionless format.
For example, because the `springBoot-3.0` feature is not specifically included in the MicroProfile, Jakarta EE, or JavaEE platforms, no `springBoot` versionless feature is available.


Expand Down

0 comments on commit c375040

Please sign in to comment.