Chapter 5. Troubleshooting migration issues
Follow these steps to use the IDE plugin to identify and resolve migration issues.
- Import the project to analyze into your IDE.
Create a run configuration. In the Issue Explorer, click the MTA icon ( ).
At a minimum, select the project to analyze. Set additional options as needed.
- Click Run to execute MTA.
- Review MTA issues listed in the Issue Explorer.
- Resolve MTA issues by manually updating code or by using quick fixes when available.
- Run MTA again as necessary. Use the drop down next to the Run button ( ) to run an existing configuration.
5.1. Creating an MTA run configuration
MTA run configurations can be created using the MTA button ( ). A run configuration specifies the project to analyze, migration path, and additional options for the execution. You can create multiple run configurations, and each must have a unique name.
Input
- Migration Path
- Select a migration path, which determines which MTA rulesets are used. The migration path defaults to Anything to EAP 7, but can be changed to any supported migration path.
- Projects
- Select one or more projects to analyze. Hold the Ctrl key to select multiple projects in the list.
- Packages
- Select one or more packages to scan. It is recommended to select only those packages that you need to analyze to reduce the overall MTA execution time. If no packages are selected, all packages in the project will be scanned. Hold the Ctrl key to select multiple packages in the list.
Options
- Report
- Check the Generate Report checkbox if you want to generate the MTA HTML report. The report will be shown in the MTA Report tab and can be found in the Issue Explorer when you group by File.
- Options
-
Set additional MTA options. Any option that is a boolean flag, such as
enableTattletale
, should usetrue
as the value. See the MTA Command-line Arguments section of the CLI Guide for a description of each MTA argument.
Rules
- Custom Rules Repositories
- Select custom rulesets to include during analysis if you have imported or created any custom MTA rules in the IDE plugin.
5.2. Running MTA
Once a run configuration has been created, you can run MTA using that configuration in one of the following ways:
- Select the run configuration from the Run Configurations dialog and click Run.
- Select a recent run configuration from the drop down next to the Run button ( ).
If the MTA server is not currently running, it will start once a run configuration is executed.
If you do not plan to run MTA in the near future, stop the MTA server to conserve memory on your machine.
Once execution is complete, the Issue Explorer will be populated with MTA issues.
5.3. Reviewing MTA issues
Use the Issue Explorer to review migration issues identified by MTA. Different icons indicate the issue’s severity and state.
Change how issues are grouped by adjusting the Group By selections: Severity, Migration Rule, and File.
Double-click the MTA issue in the Issue Explorer to open the associated line of code in an editor. Right-click and select Issue Details to view information about the MTA issue, including its severity and how to address it.
5.4. Resolving MTA issues
You can resolve MTA issues by updating the code manually or by applying a quick fix when available.
5.4.1. Resolving an issue manually
Review the MTA issue details and additional resources and update the source code as necessary. When you update a line of code marked as an MTA issue, the MTA issue will be marked with the stale icon ( ) until the next time that MTA is run on the project.
You can also manually mark an MTA issue as fixed, which will mark the issue with the resolved icon ( ) until the next time that MTA is run on the project. To mark an issue as fixed, right-click the MTA issue in the Issue Explorer and select Mark as Fixed.
5.4.2. Resolving an issue using a quick fix
Some MTA issues provide a quick fix, which assists in making the necessary edits to address the issue. See the icon legend to see the icons that indicate the MTA issue has a quick fix available.
- Previewing a quick fix
- Right-click the issue and select Preview Quick Fix. This will bring up a window that allows you to preview the change. From here, you can apply the fix or close the window.
- Applying a quick fix
- Right-click the issue and select Apply Quick Fix. This will update the source code as required and will mark the MTA issue as resolved.