Lab 2: Application Modernization with MTA
Overview
Use the Migration Toolkit for Applications (MTA) to analyze a legacy Java application, identify migration issues, and modernize it to run on a Red Hat Runtime. The modernized application will then be integrated into the CI pipeline built in Lab 1.
Install MTA
Install via OperatorHub
-
In the OpenShift Web Console, go to
-
Search for Migration Toolkit for Applications
-
Click Install
-
Accept the defaults and click Install
-
Wait for the operator to reach the
Succeededphase
Verify from the CLI:
oc get csv -n openshift-operators | grep mta
Deploy the MTA Web Console
Create a Tackle CR to deploy the MTA web console:
apiVersion: tackle.konveyor.io/v1alpha1
kind: Tackle
metadata:
name: mta
namespace: openshift-mta
spec: {}
Apply it:
oc create namespace openshift-mta
oc apply -f mta-tackle.yaml
Wait for the pods to be ready:
oc get pods -n openshift-mta -w
Get the MTA console route:
oc get route -n openshift-mta
Open the URL in your browser.
Analyze the Application
Create an Application in MTA
-
In the MTA web console, go to
-
Click Create new
-
Fill in the application details:
-
Name:
parasol-legacy -
Source repository: Your GitLab repository URL for the legacy application
-
Branch:
main
-
-
Click Create
Run the Analysis
-
Select the application and click Analyze
-
Configure the analysis:
-
Source: Source code
-
Target: Quarkus
-
Scope: Application and internal dependencies
-
-
Click Run
The analysis scans the source code, dependencies, and configuration files against MTA’s rule sets. This may take a few minutes depending on the size of the application.
Review the Analysis Report
Once the analysis completes:
-
Click on the application name to view the report
-
Review the categories:
-
Mandatory — Changes required for the migration to succeed
-
Optional — Improvements that are recommended but not required
-
Information — Context and documentation links
-
-
Note the Story Points — an effort estimate for the migration
Common findings when migrating to Quarkus:
-
Replace
javax.imports withjakarta. -
Replace Spring-specific annotations with CDI equivalents
-
Update persistence configuration from
persistence.xmltoapplication.properties -
Replace JAX-RS application class with Quarkus RESTEasy Reactive
Modernize the Application
Apply the changes identified by MTA. Work through the mandatory issues first:
Update Dependencies
Update pom.xml to use Quarkus BOM and extensions:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus.platform</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Update Imports and Annotations
Replace javax with jakarta package imports:
// Before
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
// After
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
Update Configuration
Move configuration from XML files to application.properties:
# Database configuration
quarkus.datasource.db-kind=postgresql
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/parasol
quarkus.datasource.username=${DB_USER:parasol}
quarkus.datasource.password=${DB_PASSWORD:parasol}
# Hibernate
quarkus.hibernate-orm.database.generation=update
Integrate with the CI Pipeline
Push the modernized application into the CI pipeline from Lab 1:
-
Commit and push the modernized source code to GitLab:
git add . git commit -m "Modernize application to Quarkus" git push -
The GitLab webhook triggers the Tekton pipeline automatically
-
Monitor the pipeline run:
tkn pipelinerun logs -f -n <your_namespace> -
Verify the pipeline completes all tasks:
-
Source clone
-
Maven build and test
-
Vault credential retrieval
-
Container image build and push
-
-
Confirm Argo CD syncs the updated image:
oc get application parasol-dev -n openshift-gitops \ -o jsonpath='{.status.sync.status}' -
Verify the modernized application is running:
oc get pods -n parasol-dev oc get route parasol-insurance -n parasol-dev -o jsonpath='{.spec.host}'
Open the route URL to confirm the modernized application is accessible and functional.
Summary
You have:
-
Installed MTA and analyzed a legacy Java application
-
Identified mandatory and optional migration issues with effort estimates
-
Modernized the application to use Quarkus and Jakarta EE APIs
-
Integrated the modernized application into the existing CI/CD pipeline
-
Verified end-to-end deployment through the GitOps workflow
Next Steps
Proceed to Install and configure Red Hat Developer Hub.