Migrate from your current JEE app server to Open Liberty in a few easy steps

The nine-part series Migrating Java Microservices from Spring Boot to MicroProfile covered the underlying components of Eclipse MicroProfile, such as the Rest Client for creating APIs for microservice applications, Context Dependency Injection for supporting annotation-based wiring, Fault Tolerance for problem recovery, and OpenTracing for diagnosing service issues.

This short blog touches on a specific how-to: Simple steps to migrate from your current JEE application server to Open Liberty, an enterprise-grade open-source application server. To demonstrate the steps, this blog will excerpt the required file changes using our reference implementation storefront app, BlueCompute. It’s implemented in both Spring and MicroProfile (GitHub source); the following two sections will cover the steps for each implementation migration.


MicroProfile: Steps for migrating your Java microservices app to Open Liberty

Clicking onto the BlueCompute repository’s MicroProfile branch will redirect you to the overall repository, but each microservice has its own build we must configure to use Open Liberty. To assist us, Liberty has a Maven plugin with documentation to help manage these configurations. If building with Gradle, you can check out Liberty’s Gradle plugin for its set of documentation.

Maven Coordinates (properties, artifactId): The excerpts below feature the orders repository, which uses the default approach of locating Maven artifacts. To edit this and other build details, we modified the pom.xml:

// wlp runtime properties
<groupId.liberty-runtime>com.ibm.websphere.appserver.runtime
  </groupId.liberty-runtime>
<artifactId.liberty-runtime>wlp-webProfile8
  </artifactId.liberty-runtime>
<version.liberty-runtime>18.0.0.4
  </version.liberty-runtime>
Scroll to view full table

In this case, the pom.xml is pointing to WebSphere Liberty WebProfile 8, version 18.0.0.4. Therefore, switching the runtime only requires swapping the group ID and artifact ID to specify Open Liberty instead:

// Open Liberty runtime properties
<groupId.liberty-runtime>io.openliberty</groupId.liberty-runtime>
<artifactId.liberty-runtime>openliberty-runtime</artifactId.liberty-runtime>
<version.liberty-runtime>18.0.0.4</version.liberty-runtime>
Scroll to view full table

When choosing a runtime version, you can refer to the Open Liberty download page for a list of options. The repository also includes a README that explains how to deploy the app on Open Liberty.

Spring Boot: Steps for migrating your Java microservices app to Open Liberty

Luckily for us, Open Liberty has the Maven Boost plugin to make our lives much simpler, giving us a good place to start with a Spring app. Before we begin, we must first enable the Boost plugin in our pom.xml:

// Enable the Boost Maven Plugin
<plugin>
  <groupId>io.openliberty.boost</groupId>
  <artifactId>boost-maven-plugin</artifactId>
  <version>0.1.1</version>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>package</goal>
        </goals>
    </execution>
  </executions>
</plugin>>
Scroll to view full table

To build the app for the Open Liberty runtime, we simply run the mvn package command. This will produce three jars in the resulting target directory—one containing the original app (jar.original), the app on Spring (jar.spring), and the app on Open Liberty (<application_name>.jar).

Similarly, the Spring branch also features a README to show how to run the Spring version of the app on Open Liberty.

What’s next

As you can see, the Gradle and Maven Boost assistant plugins simplify the process of moving a Spring or MicroProfile-based Java application to Open Liberty with a few simple changes. The Open Liberty open-source project can act as a playground for some various modern DevOps technologies, such as Docker and Kubernetes. If you’d like to learn more, click a component in the following MicroProfile diagram; it will lead you to a corresponding blog in the series that goes into more implementation details:


For the developers more interested in studying microservices in general, check out the the Eclipse MicroProfile community, which seeks to optimize Enterprise Java. MicroProfile bundles many beneficial features for managing your app from various angles. You can start exploring using these sample app repositories that also run on the Open Liberty runtime.

Finally, you can participate in the Open Liberty GitHub community and explore the Open Liberty guides for more learning material about microservices app development.

More from Cloud

Clients can strengthen defenses for their data with IBM Storage Defender, now generally available

2 min read - We are excited to inform our clients and partners that IBM Storage Defender, part of our IBM Storage for Data Resilience portfolio, is now generally available. Enterprise clients worldwide continue to grapple with a threat landscape that is constantly evolving. Bad actors are moving faster than ever and are causing more lasting damage to data. According to an IBM report, cyberattacks like ransomware that used to take months to fully deploy can now take as little as four days. Cybercriminals…

2 min read

Integrating data center support: Lower costs and decrease downtime with your support strategy

3 min read - As organizations and their data centers embrace hybrid cloud deployments, they have a rapidly growing number of vendors and workloads in their IT environments. The proliferation of these vendors leads to numerous issues and challenges that overburden IT staff, impede clients’ core business innovations and development, and complicate the support and operation of these environments.  Couple that with the CIO’s priorities to improve IT environment availability, security and privacy posture, performance, and the TCO, and you now have a challenge…

3 min read

Using advanced scan settings in the IBM Cloud Security and Compliance Center

5 min read - Customers and users want the ability to schedule scans at the timing of their choice and receive alerts when issues arise, and we’re happy to make a few announcements in this area today: Scan frequency: Until recently, the IBM Cloud® Security and Compliance Center would scan resources every 24 hours, by default, on all of the attachments in an account. With this release, users can continue to run daily scans—which is the recommended option—but they also have the option for…

5 min read

Modernizing child support enforcement with IBM and AWS

7 min read - With 68% of child support enforcement (CSE) systems aging, most state agencies are currently modernizing them or preparing to modernize. More than 20% of families and children are supported by these systems, and with the current constituents of these systems becoming more consumer technology-centric, the use of antiquated technology systems is archaic and unsustainable. At this point, families expect state agencies to have a modern, efficient child support system. The following are some factors driving these states to pursue modernization:…

7 min read