Chapter 2. Installing and Running the CLI
2.1. Installing the CLI Copy linkLink copied to clipboard!
You can install the CLI on Linux, Windows, or macOS operating systems using the downloadable .zip file.
Starting from MTA 7.2.0, you can run the application analysis for Java applications in the containerless mode.
The containerless mode is set by default and is used automatically if all requirements are met. For more information, see Running the containerless CLI.
However, if you want to analyze applications in languages other than Java or, for example, use transformation commands, you still need to use containers.
Prerequisites for containerized CLI
The following are the prerequisites for the Migration Toolkit for Applications (MTA) CLI installation (container):
-
Red Hat Container Registry Authentication for
registry.redhat.io. Red Hat distributes container images fromregistry.redhat.io, which requires authentication. For more details, see Red Hat Container Registry Authentication. - Podman must be installed.
- 8 GB of RAM is required for the MTA CLI.
Prerequisites for containerless CLI
The following are the prerequisites if you want to to run MTA CLI as in containerless CLI mode:
Java Development Kit (JDK) is installed.
MTA supports the following JDKs:
- Oracle JDK 17 or later
- Eclipse Temurin™ JDK 17 or later
OpenJDK 17 or later
If you install OpenJDK on Red Hat Enterprise Linux (RHEL) or Fedora, the JDK requires a compiler provided by the
develpackage to also be installed, as having only the Java Runtime (JRE) installed causes issues during analysis. For more information about installing Red Hat build of OpenJDK 17 on Red Hat Enterprise Linux (RHEL), see Installing Red Hat build of OpenJDK on RHEL by using yum.
-
You must set the
JAVA_HOMEand thePATHenvironment variables. -
Maven 3.9.9 installed, and the bin directory is added to the
PATHenvironment variable. Setting the path and environment variables depends on the operating system you are using. For more information about installing Maven, see Apache Maven installation. macOS installation requires:
-
The value of
maxprocmust be2048or greater.
-
The value of
2.1.1. Installing the CLI .zip file Copy linkLink copied to clipboard!
Procedure
Navigate to the MTA Download page and download the OS-specific CLI file or the
srcfile:- mta-7.2.3-cli-linux-amd64.zip
- mta-7.2.3-cli-linux-arm64.zip
- mta-7.2.3-cli-darwin-amd64.zip
- mta-7.2.3-cli-darwin-arm64.zip
- mta-7.2.3-cli-windows-amd64.zip
- mta-7.2.3-cli-windows-arm64.zip
- mta-7.2.3-cli-src.zip
Extract the
.zipfile to the.kantradirectory inside your$HOMEdirectory. The.zipfile extracts the mta-cli binary, along with other required directories and files.When you encounter
<MTA_HOME>in this guide, replace it with the actual path to your MTA installation.
2.1.2. Installing the CLI by using Podman Copy linkLink copied to clipboard!
You can install the containerized CLI using podman pull.
You cannot install the containerless CLI using Podman as this procedure does not include pulling and unpacking the dependencies that are included in the .zip file.
Prerequisites
-
Red Hat Container Registry Authentication for
registry.redhat.io. Red Hat distributes container images fromregistry.redhat.io, which requires authentication. See Red Hat Container Registry Authentication for additional details. - Podman must be installed.
Podman is a daemonless, open source, Linux-native tool designed to make it easy to find, run, build, share, and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command-line interface (CLI) familiar to anyone who has used the Docker Container Engine. For more information on installing and using Podman, see Podman installation instructions.
Procedure
Use Podman to authenticate to
registry.redhat.ioby running the following command:podman login registry.redhat.io
$ podman login registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the user name and password:
Username: <username> Password: <***********>
Username: <username> Password: <***********>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the binary
PATHto enable system-wide use by running the following command:podman cp $(podman create registry.redhat.com/mta-toolkit/mta-mta-cli-rhel9:{ProductVersion}):/usr/local/bin/mta-cli ./$ podman cp $(podman create registry.redhat.com/mta-toolkit/mta-mta-cli-rhel9:{ProductVersion}):/usr/local/bin/mta-cli ./Copy to Clipboard Copied! Toggle word wrap Toggle overflow WarningAlthough installation using Podman is possible, downloading and installing the
.zipfile is the preferred installation.
Podman setup and configuration consists of numerous variables that are not within the scope of this documentation. For further details on Podman, see Familiarizing yourself with Podman.
For details on troubelshooting Podman, see A list of common issues and solutions for Podman.
2.1.3. Installing the CLI for use with Docker on Windows (Developer Preview) Copy linkLink copied to clipboard!
You can install the CLI for use with Docker on Windows. This is the required approach when migrating applications built with .NET framework 4.5 or later on Windows to cross-platform .NET 8.0.
Prerequisites
- A host with Windows 11+ 64-bit version 21H2 or higher.
- You have download the Docker Desktop for Windows installer. See Install Docker Desktop on Windows for additional details.
Procedure
- Open a PowerShell with Administrator privileges.
Ensure Hyper-V is installed and enabled:
PS C:\Users\<your_user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName Microsoft-Hyper-V-All
PS C:\Users\<your_user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName Microsoft-Hyper-V-AllCopy to Clipboard Copied! Toggle word wrap Toggle overflow PS C:\Users\<your_user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName Containers
PS C:\Users\<your_user_name>> Enable-WindowsOptionalFeature -Online ` -FeatureName ContainersCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou may need to reboot Windows.
Install Docker Desktop on Windows.
-
Double-click
Docker_Desktop_Installer.exeto run the installer. By default, Docker Desktop is installed atC:\Program Files\Docker\Docker. - Deselect the Use WSL 2 instead of Hyper-V option on the Configuration page to ensure that Docker will run Windows containers as the backend instead of Linux containers.
-
Double-click
In PowerShell, create a folder for MTA:
PS C:\Users\<your_user_name>> mkdir C:\Users\<your_user_name>\MTA
PS C:\Users\<your_user_name>> mkdir C:\Users\<your_user_name>\MTACopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<your_user_name>with the username for your home directory.Extract the
mta-7.2.3-cli-windows.zipfile to theMTAfolder:PS C:\Users\<your_user_name>> cd C:\Users\<your_user_name>\Downloads
PS C:\Users\<your_user_name>> cd C:\Users\<your_user_name>\DownloadsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<your_user_name>with the username for your home directory.PS C:\Users\<your_user_name>> Expand-Archive ` -Path "{ProductShortNameLower}-{ProductVersion}-cli-windows.zip" ` -DestinationPath "C:\Users\<your_user_name>\MTA"PS C:\Users\<your_user_name>> Expand-Archive ` -Path "{ProductShortNameLower}-{ProductVersion}-cli-windows.zip" ` -DestinationPath "C:\Users\<your_user_name>\MTA"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<your_user_name>with the username for your home directory.Ensure Docker is running Windows containers:
PS C:\Users\<your_user_name>> docker version
PS C:\Users\<your_user_name>> docker versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
PODMAN_BINenvironment variable to use Docker:PS C:\Users\<your_user_name>> $env:PODMAN_BIN="C:\Windows\system32\docker.exe"
PS C:\Users\<your_user_name>> $env:PODMAN_BIN="C:\Windows\system32\docker.exe"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
DOTNET_PROVIDER_IMGenvironment variable to use the upstreamdotnet-external-provider:PS C:\Users\<your_user_name>> $env:DOTNET_PROVIDER_IMG="registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:7.1.0"
PS C:\Users\<your_user_name>> $env:DOTNET_PROVIDER_IMG="registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:7.1.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
RUNNER_IMGenvironment variable to use the upstream image:double-check reference
# double-check reference PS C:\Users\<your_user_name>> $env:RUNNER_IMG="registry.redhat.io/mta/mta-cli-rhel9:7.1.0"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2. Installing MTA on a disconnected environment Copy linkLink copied to clipboard!
Starting from MTA 7.2.0, you can run the application analysis for Java applications in the containerless mode.
The containerless mode is set by default and is used automatically if all requirements are met. For more information, see Running the containerless CLI.
However, if you want to analyze applications in languages other than Java or, for example, use transformation commands, you still need to use containers.
On a connected device, first download and save the MTA binary. Then download and save the Podman images, the MTA CLI image and the provider image that you need.
Download the required MTA CLI binary from the Migration Toolkit for Applications Red Hat Developer page:
- CLI for Linux x86_64
- CLI for Linux aarch64
- CLI for MacOS x86_64
- CLI for MacOS aarch64
- CLI for Windows x86_64
- CLI for Windows aarch64
- On a connected device, download and save the images.
- Copy the binary to the disconnected device.
- In addition, you must save and import the associated container images by using Podman.
2.2.1. Downloading the Podman images Copy linkLink copied to clipboard!
Prerequisites
- Podman installed. For more information, see Podman.
Procedure
Use Podman to authenticate to registry.redhat.io:
podman login registry.redhat.io
$ podman login registry.redhat.ioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter your username and then your password for registry.redhat.io:
Username: <registry_service_account_username> Password: <registry_service_account_password>
Username: <registry_service_account_username> Password: <registry_service_account_password>Copy to Clipboard Copied! Toggle word wrap Toggle overflow You should see the following output:
Login Succeeded!
Login Succeeded!Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use Podman to pull the image from the registry:
podman pull registry.redhat.io/mta/mta-cli-rhel9:7.1.0
$ podman pull registry.redhat.io/mta/mta-cli-rhel9:7.1.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use Podman to pull the provider image that you need from the registry:
For Java, run:
podman pull registry.redhat.io/mta/mta-java-external-provider-rhel9:7.1.0
$ podman pull registry.redhat.io/mta/mta-java-external-provider-rhel9:7.1.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow For .NET, run:
podman pull registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:7.1.0
$ podman pull registry.redhat.io/mta/mta-dotnet-external-provider-rhel9:7.1.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Save the images:
podman save <image> -o <my_image.image>
$ podman save <image> -o <my_image.image>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Copy the
.imagefile and the binary onto a USB or directly to the file system of the disconnected device. On the disconnected device, run
podman load --input <my_image.image>
$ podman load --input <my_image.image>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.2.2. CLI known issues Copy linkLink copied to clipboard!
Limitations with Podman on Microsoft Windows
The CLI is built and distributed with support for Microsoft Windows.
However, when running any container image based on Red Hat Enterprise Linux 9 (RHEL9) or Universal Base Image 9 (UBI9), the following error can be returned when starting the container:
Fatal glibc error: CPU does not support x86-64-v2
Fatal glibc error: CPU does not support x86-64-v2
This error is caused because Red Hat Enterprise Linux 9 or Universal Base Image 9 container images must be run on a CPU architecture that supports x86-64-v2.
For more details, see (Running Red Hat Enterprise Linux 9 (RHEL) or Universal Base Image (UBI) 9 container images fail with "Fatal glibc error: CPU does not support x86-64-v2").
CLI runs the container runtime correctly. However, different container runtime configurations are not supported.
Although unsupported, you can run CLI with Docker instead of Podman, which would resolve this issue.
To achieve this, you replace the PODMAN_BIN path with the path to Docker.
For example, if you experience this issue, instead of issuing:
PODMAN_BIN=/usr/local/bin/docker mta-cli analyze
PODMAN_BIN=/usr/local/bin/docker mta-cli analyze
You replace PODMAN_BIN with the path to Docker:
<Docker Root Dir>=/usr/local/bin/docker mta-cli analyze
<Docker Root Dir>=/usr/local/bin/docker mta-cli analyze
While this is not supported, it would allow you to explore CLI while you work to upgrade your hardware or move to hardware that supports x86_64-v2.
2.3. Running the CLI Copy linkLink copied to clipboard!
Depending on your scenario, you can use the Migration Toolkit for Applications (MTA) CLI to run the analysis in the following ways:
- Run the analysis against a single application.
Run the analysis against multiple applications:
-
In MTA versions earlier than 7.1.0, you can enter a series of
--analyzecommands, each against an application and each generating a separate report. For more information, see Running the MTA CLI against an application. -
In MTA 7.1.0 and later, you can use the
--bulkoption to analyze multiple applications at once and generate a single report. Note that this feature is a Developer Preview feature only. For more information, see Running the MTA CLI against multiple applications and generating a single report (Developer Preview).
-
In MTA versions earlier than 7.1.0, you can enter a series of
Starting from MTA 7.2.0, you can run the application analysis in the containerless mode. Note that this option is set by default and is used automatically if all requirements are met. For more information, see Running the containerless CLI.
2.3.1. Running the MTA CLI against an application Copy linkLink copied to clipboard!
You can run the Migration Toolkit for Applications (MTA) CLI against an application.
Procedure
-
Open a terminal and navigate to the
<MTA_HOME>/directory. Run the
mta-cliscript, ormta-cli.exefor Windows, and specify the appropriate arguments:./mta-cli analyze --input <path_to_input> \ --output <path_to_output> --source <source_name> --target <target_source> \$ ./mta-cli analyze --input <path_to_input> \ --output <path_to_output> --source <source_name> --target <target_source> \Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
--input: The application to be evaluated. -
--output: The output directory for the generated reports. -
--source: The source technology for the application migration. For example,weblogic. -
--target: The target technology for the application migration. For example,eap8.
-
- Access the report.
2.3.1.1. MTA command examples Copy linkLink copied to clipboard!
Running MTA on an application archive
The following command analyzes the example EAR archive named jee-example-app-1.0.0.ear for migrating from JBoss EAP 5 to JBoss EAP 7:
<MTA_HOME>/mta-cli analyze \
--input <path_to_jee-example-app-1.0.0.ear> \
--output <path_to_report_output> --source eap5 --target eap7 \
$ <MTA_HOME>/mta-cli analyze \
--input <path_to_jee-example-app-1.0.0.ear> \
--output <path_to_report_output> --source eap5 --target eap7 \
Running MTA on source code
The following command analyzes the source code of an example application called customer-management for migrating to JBoss EAP 8.
<MTA_HOME>/mta-cli analyze --mode source-only --input <path_to_customer-management>
$ <MTA_HOME>/mta-cli analyze --mode source-only --input <path_to_customer-management>
--output <path_to_report_output> --target eap8
Running cloud-readiness rules
The following command analyzes the example EAR archive named jee-example-app-1.0.0.ear for migrating to JBoss EAP 7. It also evaluates the archive for cloud readiness:
<MTA_HOME>/mta-cli analyze --input <path_to_jee-example-app-1.0.0.ear> \
--output <path_to_report_output> \
--target eap7
$ <MTA_HOME>/mta-cli analyze --input <path_to_jee-example-app-1.0.0.ear> \
--output <path_to_report_output> \
--target eap7
2.3.2. Running the MTA CLI against multiple applications and generating a single report (Developer Preview) Copy linkLink copied to clipboard!
You can now run the Migration Toolkit for Applications (MTA) CLI against multiple applications and generate a combined report. This can save you time and give you a better idea of how to prepare a set of applications for migration.
This feature is currently a Developer Preview feature.
Running the CLI against one or more applications is a Developer Preview feature only. Developer Preview features are not supported by Red Hat in any way and are not functionally complete or production-ready. Do not use Developer Preview features for production or business-critical workloads. Developer Preview features provide early access to upcoming product features in advance of their possible inclusion in a Red Hat product offering, enabling customers to test functionality and provide feedback during the development process. These features might not have any documentation, are subject to change or removal at any time, and testing is limited. Red Hat might provide ways to submit feedback on Developer Preview features without an associated SLA.
Procedure
-
Open a terminal and navigate to the
<MTA_HOME>/directory. Run the
mta-cliscript, ormta-cli.exefor Windows, and specify the appropriate arguments, entering one input peranalyzecommand, but entering the same output directory for all inputs. For example, to analyze applications A, B, and C:Enter the following command for input A:
./mta-cli analyze --bulk --input=<path_to_input_A> --output=<path_to_output_ABC> --source <source_A> --target <target_A>
$ ./mta-cli analyze --bulk --input=<path_to_input_A> --output=<path_to_output_ABC> --source <source_A> --target <target_A>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
--input: The application to be evaluated. -
--output: The output directory for the generated reports. -
--source: The source technology for the application migration. For example,weblogic. -
--target: The target technology for the application migration. For example,eap8.
-
Enter the following command for input B:
./mta-cli analyze --bulk --input=<path_to_input_B> --output=<path_to_output_ABC> --source <source_B> --target <target_B>
$ ./mta-cli analyze --bulk --input=<path_to_input_B> --output=<path_to_output_ABC> --source <source_B> --target <target_B>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the following command for input C:
./mta-cli analyze --bulk --input=<path_to_input_C> --output=<path_to_output_ABC> --source <source_C> --target <target_C>
$ ./mta-cli analyze --bulk --input=<path_to_input_C> --output=<path_to_output_ABC> --source <source_C> --target <target_C>Copy to Clipboard Copied! Toggle word wrap Toggle overflow MTA generates a single report, listing all issues that need to be resolved before the applications can be migrated.
- Access the report.
2.3.3. Performing analysis using the command line Copy linkLink copied to clipboard!
Analyze supports running source code and binary analysis by using the analyzer-lsp tool. analyzer-lsp evaluates the rules for the providers and determines rule matches.
Extracting the list of dependencies from compiled Java binaries is not always possible during analysis, especially if the dependencies are not embedded within the binary.
To run analysis on application source code, run the following command:
mta-cli analyze --input=<path_to_source_code> --output=<path_to_output_directory>
mta-cli analyze --input=<path_to_source_code> --output=<path_to_output_directory>
All flags:
The list of flags above does not include the --bulk flag because this flag is only offered as part of a Developer Preview feature. That feature is described in Support for providing a single report when analyzing multiple applications on the CLI.
Usage example
- Get an example application to run analysis on.
List available target technologies.
mta-cli analyze --list-targets
mta-cli analyze --list-targetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run an analysis with a specified target technology, for example
cloud-readiness.mta-cli analyze --input=<path-to/example-applications/example-1> --output=<path-to-output-dir> --target=cloud-readiness
mta-cli analyze --input=<path-to/example-applications/example-1> --output=<path-to-output-dir> --target=cloud-readinessCopy to Clipboard Copied! Toggle word wrap Toggle overflow Several analysis reports are created in your specified output path:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
output.yamlis the file that contains the issues report. -
static-reportcontains the static HTML report. -
dependencies.yamlcontains the dependencies report.
-
2.3.4. Running the containerless CLI Copy linkLink copied to clipboard!
Starting from MTA 7.2.0, you can perform an application analysis for Java applications by using the MTA CLI that does not require installation of a container runtime.
In MTA 7.2.0 and later, containerless CLI is a default mode. To enable container runtime usage, you must set the --run-local flag to false:
--run-local=false
--run-local=false
Prerequisites
- You have OpenJDK version 17 or later installed on your system.
- You have Maven version 3.9.9 or later installed on your system.
The CLI assumes that a path to the
mvnbinary is correctly registered in the system variable. Therefore, ensure that you addedmvnto the following variable:-
Pathfor Windows. -
PATHfor Linux and macOS.
-
-
You have the
JAVA_HOMEenvironmental variable set. You have the
JVM_MAX_MEMsystem variable set.NoteIf you do not set
JVM_MAX_MEM, the analysis might hang.
Procedure for Linux
After unpacking the whole zip file to ~/.kantra, add that path to the $PATH variable.
Moving the mta-cli binary to /usr/bin requires root privileges, whereas adding that path to $PATH variable does not require root privileges.
To extract the dependency zip file to
~/.kantra, run:unzip $HOME/mta-cli.<os>.<arch>.zip -d $HOME/.kantra
unzip $HOME/mta-cli.<os>.<arch>.zip -d $HOME/.kantraCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add as a system-wide binary or add to the global
$PATHvariable:For example, to add the
mta-clibinary to/usr/binas a system-wide binary, usingsudo, run:sudo mv ~/.kantra/mta-cli /usr/bin/
sudo mv ~/.kantra/mta-cli /usr/bin/Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to add to the global
$PATHvariable, run:export PATH=$HOME/.kantra:$PATH
export PATH=$HOME/.kantra:$PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow
NoteThe CLI can run with the requirements moved to the directory from which you run an analysis. During the analysis, the CLI checks for the requirements in this directory first, and if it does not find the requirements, it searches for them in the
$HOME/.kantradirectory.Optional: Display all
mta-cli analyzecommand options:mta-cli analyze --help
mta-cli analyze --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the application analysis:
mta-cli analyze --overwrite --input <path_to_input> --output <path_to_output> --target <target_source>
$ mta-cli analyze --overwrite --input <path_to_input> --output <path_to_output> --target <target_source>Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command arguments represent the following:
-
--overwrite: Overwrites the output folder if it exists. -
--input: The application to be analyzed. -
--output: The output directory for the generated reports. -
--target: The target technology for the application migration, for example,eap8.
-
2.3.5. Performing transformation by using the command line Copy linkLink copied to clipboard!
You can use transformation to perform the following actions:
-
Transform Java applications source code by using the
transform openrewritecommand. -
Convert XML rules to YAML rules by using the
transform rulescommand.
Performing transformation requires the container runtime to be configured. For more information, see Installing the CLI by using Podman.
2.3.5.1. OpenRewrite Copy linkLink copied to clipboard!
The openrewrite subcommand allows running OpenRewrite recipes on source code.
To run transform openrewrite on application source code, run the following command:
mta-cli transform openrewrite --input=<path/to/source/code> --target=<exactly_one_target_from_the_list>
mta-cli transform openrewrite --input=<path/to/source/code> --target=<exactly_one_target_from_the_list>
You can only use a single target to run the transform overwrite command.
2.3.5.2. Rules Copy linkLink copied to clipboard!
You can use the rules subcommand of the transform command to convert mta XML rules to analyzer-lsp YAML rules. To covert rules, the rules subcommand uses the windup-shim tool.
analyzer-lsp evaluates the rules for the providers and determines rule matches.
To run transform rules on application source code, run the following:
mta-cli transform rules --input=<path/to/xmlrules> --output=<path/to/output/dir>
mta-cli transform rules --input=<path/to/xmlrules> --output=<path/to/output/dir>
Usage example
- Get an example application to transform source code.
View the available OpenRewrite recipes.
mta-cli transform openrewrite --list-targets
mta-cli transform openrewrite --list-targetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run a recipe on the example application.
mta-cli transform openrewrite --input=<path-to/jakartaee-duke> --target=jakarta-imports
mta-cli transform openrewrite --input=<path-to/jakartaee-duke> --target=jakarta-importsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Inspect the
jakartaee-dukeapplication source code diff to see the transformation.
2.3.5.3. Available OpenRewrite recipes Copy linkLink copied to clipboard!
| Migration path | Purpose | rewrite.configLocation | activeRecipes |
|---|---|---|---|
| Java EE to Jakarta EE |
Replace import of
Replace |
|
|
| Java EE to Jakarta EE | Rename bootstrapping files |
|
|
| Java EE to Jakarta EE |
Transform |
|
|
| Spring Boot to Quarkus |
Replace |
|
|
2.4. Accessing reports Copy linkLink copied to clipboard!
When you run the Migration Toolkit for Applications, a report is generated in the <OUTPUT_REPORT_DIRECTORY> that you specify using the --output argument in the command line.
The output directory contains the following files and subdirectories:
Procedure
Obtain the path of the
index.htmlfile of your report from the output that appears after you run MTA:Report created: <OUTPUT_REPORT_DIRECTORY>/index.html Access it at this URL: file:///<OUTPUT_REPORT_DIRECTORY>/index.htmlReport created: <OUTPUT_REPORT_DIRECTORY>/index.html Access it at this URL: file:///<OUTPUT_REPORT_DIRECTORY>/index.htmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open the
index.htmlfile by using a browser.The generated report is displayed.
2.5. Analyzing multi-language applications with CLI Copy linkLink copied to clipboard!
Starting from MTA 7.1.0, you can run the application analysis on applications written in multiple languages. You can perform the analysis either of the following ways:
- Select the supported language provider to run the analysis for.
- Override the existing supported language provider with your own unsupported language provider and run the analysis for this unsupported provider.
2.5.1. Analyzing a multi-language application for the selected supported language provider Copy linkLink copied to clipboard!
When analyzing a multi-language application with Migration Toolkit for Applications (MTA) CLI, you can explicitly set a supported language provider according to your application language to run the analysis for.
Prerequisites
- You are running the latest version of MTA CLI.
Procedure
List language providers supported for the analysis:
mta-cli analyze --list-providers
$ mta-cli analyze --list-providersCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the application analysis for the selected language provider:
mta-cli analyze --input <_path_to_the_source_repository_> --output <_path_to_the_output_directory_> --provider <_language_provider_> --rules <_path_to_custom_rules_>
$ mta-cli analyze --input <_path_to_the_source_repository_> --output <_path_to_the_output_directory_> --provider <_language_provider_> --rules <_path_to_custom_rules_>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that if you do not set the
--provideroption, the analysis might fail because it detects unsupported providers. The analysis will complete without--provideronly if all discovered providers are supported.
2.5.2. Analyzing a multi-language application for an unsupported language provider Copy linkLink copied to clipboard!
When analyzing a multi-language application with Migration Toolkit for Applications (MTA) CLI, you can run the analysis for an unsupported language provider. To do so, you must override an existing supported language provider with your own unsupported language provider by using the --override-provider-settings option.
You must create a configuration file for your unsupported language provider before overriding the supported provider.
Prerequisites
- You created a configuration file for your unsupported language provider.
Procedure
Override an existing supported language provider with your unsupported provider:
mta-cli analyze --override-provider-settings <path_to_configuration_file> --output=<path_to_the_output_directory> --rules <path_to_custom_rules>
$ mta-cli analyze --override-provider-settings <path_to_configuration_file> --output=<path_to_the_output_directory> --rules <path_to_custom_rules>Copy to Clipboard Copied! Toggle word wrap Toggle overflow