Visual Studio Code Extension Guide
Identify and resolve migration issues by analyzing your applications with the Migration Toolkit for Applications extension for Visual Studio Code.
Abstract
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. Introduction
1.1. About the MTA extension for Microsoft Visual Studio Code
You can migrate and modernize applications by using the Migration Toolkit for Applications (MTA) extension for Microsoft Visual Studio Code.
The MTA extension analyzes your projects using customizable rulesets, marks issues in the source code, provides guidance to fix the issues, and offers automatic code replacement, if possible.
The MTA extension is also compatible with Visual Studio Codespaces, the Microsoft cloud-hosted development environment.
1.2. About the Migration Toolkit for Applications
What is the Migration Toolkit for Applications?
The Migration Toolkit for Applications (MTA) is an extensible and customizable rule-based tool that simplifies the migration and modernization of Java applications.
MTA examines application artifacts, including project source directories and application archives, and then produces an HTML report highlighting areas needing changes. MTA supports many migration paths including the following examples:
- Upgrading to the latest release of Red Hat JBoss Enterprise Application Platform
- Migrating from Oracle WebLogic or IBM WebSphere Application Server to Red Hat JBoss Enterprise Application Platform
- Containerizing applications and making them cloud-ready
- Migrating from Java Spring Boot to Quarkus
- Updating from Oracle JDK to OpenJDK
For more information about use cases and migration paths, see the MTA for developers web page.
How does the Migration Toolkit for Applications simplify migration?
The Migration Toolkit for Applications looks for common resources and known trouble spots when migrating applications. It provides a high-level view of the technologies used by the application.
MTA generates a detailed report evaluating a migration or modernization path. This report can help you to estimate the effort required for large-scale projects and to reduce the work involved.
How do I learn more?
See the Introduction to the Migration Toolkit for Applications to learn more about the features, supported configurations, system requirements, and available tools in the Migration Toolkit for Applications.
Chapter 2. Installing the MTA extension for Visual Studio Code
You can install the MTA extension for Visual Studio Code (VS Code).
Prerequisites
Java Development Kit (JDK) installed. MTA supports the following JDKs:
- OpenJDK 1.8
- OpenJDK 11
- Oracle JDK 1.8
- Oracle JDK 11
- 8 GB RAM
-
macOS installation: the value of
maxproc
must be2048
or greater.
Procedure
Set the environmental variable
JAVA_HOME
:$ export JAVA_HOME=jdk11
- In VS Code, click the Extensions icon on the Activity bar to open the Extensions view.
-
Enter
Migration Toolkit for Applications
in the Search field. Select the Migration Toolkit for Applications extension and click Install.
The MTA extension icon (
) is displayed on the Activity bar.
Chapter 3. Analyzing your projects with the MTA extension
You can analyze your projects with the MTA extension by creating a run configuration and running an analysis.
3.1. MTA extension interface
The interface of the Migration Toolkit for Applications (MTA) extension is designed to make it easier for you to find information and perform actions:
- In the left pane, you can see a directory tree named Analysis Results with a report icon at its top. You can click the icon to open the MTA report in your browser. Beneath the report icon are the other elements of the tree: the applications analyzed by MTA, the rulesets used, and the issues discovered by the analysis.
- In the upper right pane, you can configure an analysis.
- In the lower right pane, you can see the settings of the configuration, including source, target, and advanced options. You can view the progress of an analysis in this pane. When the analysis is completed, you can click the Open Report button to open the MTA report, which describes any issues you need to address before you migrate or modernize your application. For more information, see MTA report in the CLI Guide.
Figure 3.1. MTA extension interface

3.2. Configuring a run configuration
You can configure multiple run configurations to run against each project you import to VS Code.
Procedure
-
In Extensions view, click the Migration Toolkit for Applications icon (
) on the Activity bar.
- Click the + (plus sign) next to Migration Toolkit for Applications to add a run configuration.
Complete the following configuration fields:
Input: Click Add and do one of the following:
- Enter the input file or directory and press Enter.
- Click Open File Explorer and select the directory.
- Target: Select one or more target migration paths.
Right-click the run configuration and select Run.
When the analysis is completed, you can click the Open Report button to open the MTA report, which describes any issues you need to address before you migrate or modernize your application. For more information, see MTA report in the CLI Guide.
Chapter 4. Reviewing and resolving migration issues
You can review and resolve migration issues identified by the MTA extension in the left pane.
4.1. Reviewing issues
You can use the MTA extension icons to prioritize issues based on their severity. You can also see which issues have a Quick Fix automatic code replacement.
Procedure
- Select a run configuration directory on the left pane.
- Expand its folders to view the Hints generated for each application file.
- Select a hint to view the source code.
- Right-click a hint and select View Details to view the Rule ID and other information.
Prioritize issues based on the following icons, which are displayed next to each hint:
-
: The issue must be fixed for a successful migration.
-
: The issue might need to be addressed during migration.
-
: The issue is optional to fix for migration. This icon is also used to indicate any Quick Fixes available for an issue.
-
4.2. Resolving issues
You can resolve issues by doing one of the following:
- Using a Quick Fix automatic code replacement
- Editing the code of a file with a hint
You can keep track of resolved issues by using the Delete or Mark as Complete options. Files marked deleted or completed will be analyzed again the next time you analyze a project that contains them.
4.2.1. Using a Quick Fix
You can use a Quick Fix automatic code replacement to save time and ensure consistency in resolving repetitive issues.
Procedure
-
In the left pane, right-click an issue that has the Quick Fix icon (
) and select Preview Quick Fix.
- To accept the suggested fix, right-click the issue again and select Apply Quick Fix.
- Optional: Right-click the issue and select Mark as Complete or Delete.
4.2.2. Editing the code of a file
You can edit the file of a project imported to VS Code.
Procedure
- In the left pane, right-click an issue and select Open Code.
- Make any changes needed to the code and save the file.
- Optional: Right-click the issue and select Mark as Complete or Delete.