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

  1. In the OpenShift Web Console, go to Operators  OperatorHub

  2. Search for Migration Toolkit for Applications

  3. Click Install

  4. Accept the defaults and click Install

  5. Wait for the operator to reach the Succeeded phase

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

  1. In the MTA web console, go to Applications  Application inventory

  2. Click Create new

  3. Fill in the application details:

    • Name: parasol-legacy

    • Source repository: Your GitLab repository URL for the legacy application

    • Branch: main

  4. Click Create

Run the Analysis

  1. Select the application and click Analyze

  2. Configure the analysis:

    • Source: Source code

    • Target: Quarkus

    • Scope: Application and internal dependencies

  3. 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:

  1. Click on the application name to view the report

  2. Review the categories:

    • Mandatory — Changes required for the migration to succeed

    • Optional — Improvements that are recommended but not required

    • Information — Context and documentation links

  3. Note the Story Points — an effort estimate for the migration

Common findings when migrating to Quarkus:

  • Replace javax. imports with jakarta.

  • Replace Spring-specific annotations with CDI equivalents

  • Update persistence configuration from persistence.xml to application.properties

  • Replace JAX-RS application class with Quarkus RESTEasy Reactive

CLI Analysis (Alternative)

You can also run analysis from the command line inside your Dev Spaces workspace:

mta-cli analyze \
  --input /projects/parasol-legacy \
  --output /tmp/mta-report \
  --target quarkus

Open /tmp/mta-report/index.html in the IDE’s preview to review results.

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

Validate the Build

Build and test the modernized application in your Dev Spaces workspace:

./mvnw clean package -DskipTests=false

Start the application in dev mode to verify it runs:

./mvnw compile quarkus:dev

Quarkus Dev Services will start a PostgreSQL container automatically.

Integrate with the CI Pipeline

Push the modernized application into the CI pipeline from Lab 1:

  1. Commit and push the modernized source code to GitLab:

    git add .
    git commit -m "Modernize application to Quarkus"
    git push
  2. The GitLab webhook triggers the Tekton pipeline automatically

  3. Monitor the pipeline run:

    tkn pipelinerun logs -f -n <your_namespace>
  4. Verify the pipeline completes all tasks:

    • Source clone

    • Maven build and test

    • Vault credential retrieval

    • Container image build and push

  5. Confirm Argo CD syncs the updated image:

    oc get application parasol-dev -n openshift-gitops \
      -o jsonpath='{.status.sync.status}'
  6. 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