back to all blogsSee all blog posts

MicroProfile features supports MicroProfile 5.0 features to align with Jakarta EE 9.1 and support for multiple applications in MicroProfile OpenAPI in 21.0.0.12-beta

image of author
Ryan Storey on Nov 2, 2021

Open Liberty 21.0.0.12-beta supports some of MicroProfile 5.0 features to align with the Jakarta EE 9.1, allowing you to use MicroProfile together with Jakarta EE 9.1 applications. This release also features updates to MicroProfile OpenAPI, as it provides support for multiple applications.

We have two beta packages for Open Liberty:

  • All Beta Features: a larger package that contains all Open Liberty beta features (including Jakarta EE 9 beta features) and GA features and functions.

  • Jakarta EE 9 Beta Features: a lightweight package that contains only the Jakarta EE 9 features.

This means that you can now try out our in-development Open Liberty features by just adding the relevant coordinates to your build tools.

If you try either package, let us know what you think.

All Beta Features package

The All Beta Features package includes the following beta features:

MicroProfile JWT 2.0

With this beta, the MicroProfile JSON Web Token 2.0 feature replaces javax with jakarta in Jakarta package names allowing it to be used for Jakarta EE 9.1 applications. The old MicroProfile JSON Web Token 1.2 feature does not provide support for Jakarta EE 9.1 applications. Enabling mpJwt-2.0 instead of mpJwt-1.2 will allow those applications to use the MicroProfile JSON Web Token 2.0 feature.

You can enable the MicroProfile JSON Web Token 2.0 feature by using the mpJwt-2.0 feature in the server.xml file:

<featureManager>
  <feature>mpJwt-2.0</feature>
</featureManager>

All the attributes of the mpJwt element and all the current MP Config properties from the MP JWT 1.2 specification remain the same.

To find out more visit:

MicroProfile Health 4.0

This feature mpHealth-4.0 is the implementation of the Eclipse MicroProfile Health 4.0 release, which aligns with Jakarta EE 9.1. This feature replaces javax with jakarta in Jakarta package names allowing it to be used for Jakarta EE 9.1 applications. There is no other functional changes introduced in this feature. With this feature, you can use MicroProfile together with Jakarta EE 9.1, whereas in prior releases and versions of MicroProfile Health were for the Java EE platform and did not provide support for Jakarta EE 9.1 applications.

You can enable the MicroProfile Health 4.0 feature by using the mpHealth-4.0 feature in the server.xml file:

<featureManager>
  <feature>mpHealth-4.0</feature>
</featureManager>

To find out more visit:

MicroProfile Metrics 4.0

The MicroProfile Metrics 4.0 feature is the implementation of the Eclipse MicroProfile Metrics 4.0 release. This release (and feature) replaces javax with jakarta in Jakarta package names allowing it to be used for Jakarta EE 9.1 applications. Prior releases and versions of MicroProfile metrics were for the Java EE or Jakata EE 8 platform releases. This latest v4.0 release aligns with the Jakarta EE 9.1 platform release.

You can enable the MicroProfile Metrics 4.0 feature by using the mpMetrics-4.0 feature in the server.xml file:

<featureManager>
  <feature>mpMetrics-4.0</feature>
</featureManager>

MicroProfile Open API 3.0

This feature mpOpenAPI-3.0 is the implementation of MicroProfile OpenAPI 3.0, which aligns with Jakarta EE 9.1. There is no other functional changes introduced in this feature. With this feature, you can use MicroProfile Open API together with Jakarta EE 9.1.

You can enable the MicroProfile Open API 3.0 feature by using the mpOpenAPI-3.0 feature in the server.xml file:

<featureManager>
  <feature>mpOpenAPI-3.0</feature>
</featureManager>

MicroProfile Fault Tolerance 4.0

This feature mpFaultTolerance-4.0 is the implementation of MicroProfile Fault Tolerance 4.0, which aligns with Jakarta EE 9.1. There is no other functional changes introduced in this feature. With this feature, you can use MicroProfile together with Jakarta EE 9.1.

You can enable the MicroProfile Fault Tolerance 4.0 feature by using the mpFaultTolerance-4.0 feature in the server.xml file:

<featureManager>
  <feature>mpFaultTolerance-4.0</feature>
</featureManager>

MicroProfile Config 3.0

This feature mpConfig-3.0 is the implementation of MicroProfile Config 3.0, which aligns with Jakarta EE 9.1. There is no other functional changes introduced in this feature. With this feature, you can use MicroProfile together with Jakarta EE 9.1.

You can enable the MicroProfile Config 3.0 feature by using the mpConfig-3.0 feature in the server.xml file:

<featureManager>
  <feature>mpConfig-3.0</feature>
</featureManager>

Support multiple applications in mpOpenApi-2.0

MicroProfile OpenAPI helps you document the REST endpoints of your application by creating and serving documentation in the OpenAPI format.

MicroProfile OpenAPI can now create OpenAPI documentation for more than one application. Previously, only the first deployed web module which included a JAX-RS application would be documented. When two or more web modules containing JAX-RS applications are deployed, the MicroProfile OpenAPI feature can now create documentation for each of them and then merge that documentation together.

To enable this functionality, you must set the MicroProfile Config property mp.openapi.extensions.liberty.merged.include=all, e.g. by adding this to your server.xml:

<variable name="mp.openapi.extensions.liberty.merged.include" value="all"/>

With this property set, deploy several JAX-RS applications and visit /openapi/ui on your Open Liberty server where you should see documentation for all the applications.

The following MP Config properties can be used to configure this feature:

Name Description Default Values

mp.openapi.extensions.liberty.merged.include

List of modules which should be included in the merged OpenAPI documentation

first

  • all (to include all applications)

  • first (to include only the first web module deployed, matching the previous behavior)

  • comma-separated list of <appname> (to include individual applications) and <appname>/<modulename> (to include individual modules within an EAR)

mp.openapi.extensions.liberty.merged.exclude

  • List of modules which should be excluded from the merged OpenAPI documentation

  • Takes priority over the list of included modules

none

  • none (to exclude nothing)

  • comma-separated list of <appname> (to exclude individual applications) and <appname>/<modulename> (to exclude individual modules within an EAR)

mp.openapi.extensions.liberty.merged.info

This property sets the info section of the final Open API document

N/A

  • The value must be a valid OpenAPI info section in JSON format. If this property is set, the info section in the final OpenAPI document is replaced with the value of the property. This replacement is made after any merging is completed.

Try it now

To try out these features, just update your build tools to pull the Open Liberty All Beta Features package instead of the main release. The beta works with Java SE 17, Java SE 11, or Java SE 8.

If you’re using Maven, here are the coordinates:

<dependency>
  <groupId>io.openliberty.beta</groupId>
  <artifactId>openliberty-runtime</artifactId>
  <version>21.0.0.12-beta</version>
  <type>pom</type>
</dependency>

Or for Gradle:

dependencies {
    libertyRuntime group: 'io.openliberty.beta', name: 'openliberty-runtime', version: '[21.0.0.12-beta,)'
}

Or take a look at our Downloads page.

Jakarta EE 9 Beta Features package

Open Liberty is the first vendor product to be Jakarta EE Web Profile 9.0 compatible since the 21.0.0.2-beta release. Open Liberty is also the first vendor product to be added to the Jakarta EE Platform 9.0 compatibility list, with the release of 21.0.0.3-beta. That same beta release was then also used to add Open Liberty to the Jakarta EE Platform 9.1 compatibility list. Open Liberty 21.0.0.6-beta further expanded on this compatability by including new Jakarta EE9 supporting features, and 21.0.0.12-beta offers the same compatability with Jakarta EE9 with performance enhancements.

Enable the Jakarta EE 9 beta features in your app’s server.xml. You can enable the individual features you want or you can just add the Jakarta EE 9 convenience feature to enable all of the Jakarta EE 9 beta features at once:

  <featureManager>
    <feature>jakartaee-9.0</feature>
  </featureManager>

Or you can add the Web Profile convenience feature to enable all of the Jakarta EE 9 Web Profile beta features at once:

  <featureManager>
    <feature>webProfile-9.0</feature>
  </featureManager>

Try it now

To try out these Jakarta EE 9 features on Open Liberty in a lightweight package, just update your build tools to pull the Open Liberty Jakarta EE 9 Beta Features package instead of the main release. The beta works with Java SE 17, Java SE 11, or Java SE 8.

If you’re using Maven, here are the coordinates:

<dependency>
    <groupId>io.openliberty.beta</groupId>
    <artifactId>openliberty-jakartaee9</artifactId>
    <version>21.0.0.12-beta</version>
    <type>zip</type>
</dependency>

Or for Gradle:

dependencies {
    libertyRuntime group: 'io.openliberty.beta', name: 'openliberty-jakartaee9', version: '[21.0.0.12-beta,)'
}

Or take a look at our Downloads page.

Your feedback is welcomed

Let us know what you think on our mailing list. If you hit a problem, post a question on StackOverflow. If you hit a bug, please raise an issue.

Tags