Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Maven Plugin Guide
Integrate the Red Hat Application Migration Toolkit into the Maven build process.
Abstract
Chapter 1. Introduction Link kopierenLink in die Zwischenablage kopiert!
1.1. About the Maven Plugin Guide Link kopierenLink in die Zwischenablage kopiert!
This guide is for engineers, consultants, and others who want to use Red Hat Application Migration Toolkit (RHAMT) to migrate Java applications or other components. It describes how to install and run the Maven plugin, review the generated reports, and take advantage of additional features.
1.2. About Red Hat Application Migration Toolkit Link kopierenLink in die Zwischenablage kopiert!
What is Red Hat Application Migration Toolkit?
Red Hat Application Migration Toolkit (RHAMT) is an extensible and customizable rule-based tool that helps simplify migration of Java applications.
RHAMT examines application artifacts, including project source directories and application archives, then produces an HTML report that highlights areas needing changes. RHAMT can be used to migrate Java applications from previous versions of Red Hat JBoss Enterprise Application Platform or from other containers, such as Oracle® WebLogic Server or IBM® WebSphere® Application Server.
How Does Red Hat Application Migration Toolkit Simplify Migration?
Red Hat Application Migration Toolkit looks for common resources and highlights technologies and known trouble spots when migrating applications. The goal is to provide a high-level view into the technologies used by the application and provide a detailed report organizations can use to estimate, document, and migrate enterprise applications to Java EE and Red Hat JBoss Enterprise Application Platform.
How Do I Learn More?
See the Getting Started Guide to learn more about the features, supported configurations, system requirements, and available tools in the Red Hat Application Migration Toolkit.
1.3. About the Maven Plugin Link kopierenLink in die Zwischenablage kopiert!
The Maven plugin for Red Hat Application Migration Toolkit integrates into the Maven build process, allowing developers to continuously evaluate migration and modernization efforts with each iteration of source code. It provides numerous reports that highlight the analysis results, and is designed for developers who want updates with each build.
Chapter 2. Getting Started Link kopierenLink in die Zwischenablage kopiert!
2.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
Before using the Maven plugin, verify that you meet the following prerequisites.
- Java Platform, JRE version 8+
- A minimum of 4 GB RAM; 8 GB recommended
- Maven version 3.2.5 or later
If you are running macOS, it is recommended to set the maximum number of user processes, maxproc, to at least 2048, and the maximum number of open files, maxfiles, to 100000.
2.2. Run the Maven Plugin Link kopierenLink in die Zwischenablage kopiert!
The Maven plugin is executed by including a reference to the plugin inside your application’s pom.xml. When the application is built, the Maven plugin is executed and generates the reports for analysis.
To run the Maven plugin perform the following steps.
Include the following plugin inside your application’s
pom.xml:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
offlineMode: Indicates to run in offline mode, disabling network features to improve performance. windupVersion: Version of RHAMT.The above example demonstrates the minimum required arguments. See RHAMT Maven Arguments for a detailed description of all available arguments.
-
Build the project.
mvn clean install
$ mvn clean installCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Access the generated reports.
2.3. Run the Maven Plugin with Multiple Modules Link kopierenLink in die Zwischenablage kopiert!
To use the Maven plugin in a project with multiple modules, place the configuration inside the parent’s pom.xml. During execution the Maven plugin will generate a single report that contains the analysis for the parent and any child modules.
It is strongly recommended to set inherited to false in multi-module projects; otherwise, the Maven plugin will be executed when each child is compiled, resulting in multiple executions of the Maven plugin against the child modules. Setting inherited to false results in each project being analyzed a single time and drastically decreased run times.
To run the Maven plugin in a project with multiple modules perform the following steps.
Include the following plugin inside the parent project’s
pom.xml. The following is a samplepom.xmlfor a parent module.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This
pom.xmldeviates from the one in Run the Maven Plugin by the following attributes:-
inherited: Defined at the plugin level, this attribute indicates whether or not this configuration should be used in child modules. Set tofalsefor performance improvements. -
input: Specifies the path to the directory containing the projects to be analyzed. This attribute defaults to{project.basedir}/src/main, and should be defined if the parent project does not have source code to analyze. windupHome: A path to an extracted copy of the RHAMT CLI. This attribute is optional, but is recommended as a performance improvement.The above example demonstrates a set of recommended arguments. See RHAMT Maven Arguments for a detailed description of all available arguments.
-
Build the parent project. During the build process the Maven plugin will execute against all children in the project without further configuration.
mvn clean install
$ mvn clean installCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Once completed, Access the generated reports as normal. This report contains the analysis for the parent and all children.
2.4. Access the Report Link kopierenLink in die Zwischenablage kopiert!
When you execute Red Hat Application Migration Toolkit, the report is generated in the OUTPUT_REPORT_DIRECTORY that you specify using the outputDirectory argument in the pom.xml. Upon completion of the build, you will see the following message in the build log.
Windup report created: OUTPUT_REPORT_DIRECTORY/index.html
Windup report created: OUTPUT_REPORT_DIRECTORY/index.html
The output directory contains the following files and subdirectories:
See the Review the Reports section of the RHAMT CLI Guide for information on the RHAMT reports and how to use them to assess your migration or modernization effort.
Chapter 3. Export the Report in CSV Format Link kopierenLink in die Zwischenablage kopiert!
RHAMT provides the ability to export the report data, including the classifications and hints, to a flat file on your local file system. The export function currently supports the CSV file format, which presents the report data as fields separated by commas (,).
The CSV file can be imported and manipulated by spreadsheet software such as Microsoft Excel, OpenOffice Calc, or LibreOffice Calc. Spreadsheet software provides the ability to sort, analyze, evaluate, and manage the result data from an RHAMT report.
3.1. Export the Report Link kopierenLink in die Zwischenablage kopiert!
To export the report into a CSV file, run RHAMT with exportCSV argument set to true.
<exportCSV>true</exportCSV>
<exportCSV>true</exportCSV>
The CSV file will be created in the directory specified by the outputDirectory argument.
3.2. Import the CSV File into a Spreadsheet Program Link kopierenLink in die Zwischenablage kopiert!
- Launch the spreadsheet software, for example, Microsoft Excel.
- Choose File → Open.
- Browse to the CSV exported file and select it.
- The data is now ready to analyze in the spreadsheet software.
For more information or to resolve any issues, check the help for your spreadsheet software.
3.3. Overview of the CSV Data Structure Link kopierenLink in die Zwischenablage kopiert!
The CSV formatted output file contains the following data fields:
- Rule Id
- The ID of the rule that generated the given item.
- Problem type
- hint or classification
- Title
- The title of the classification or hint. This field summarizes the issue for the given item.
- Description
- The detailed description of the issue for the given item.
- Links
- URLs that provide additional information about the issue. A link consists of two attributes: the link and a description of the link.
- Application
- The name of the application for which this item was generated.
- File Name
- The name of the file for the given item.
- File Path
- The file path for the given item.
- Line
- The line number of the file for the given item.
- Story points
- The number of story points, which represent the level of effort, assigned to the given item.
Appendix A. Reference Material Link kopierenLink in die Zwischenablage kopiert!
A.1. Maven plugin Arguments Link kopierenLink in die Zwischenablage kopiert!
The following is a detailed description of the available RHAMT Maven plugin arguments.
| Argument | Description |
|---|---|
| enableCompatibleFilesReport | Flag to enable generation of the Compatible Files report. Due to processing all files without found issues, this report may take a long time for large applications. |
| enableTattletale | Flag to enable generate a Tattletale report for each application. |
| excludePackages | A list of packages to exclude from evaluation. For example, entering "com.mycompany.commonutilities" would exclude all classes whose package name begins with "com.mycompany.commonutilities". |
| excludeTags | A list of tags to exclude. When specified, rules with these tags will not be processed. |
| explodedApps | Flag to indicate that the provided input directory contains source files for a single application. See the Input File Argument Tables for details. |
| exportCSV |
Flag to export the report data to a CSV file on your local file system. RHAMT creates the file in the directory specified by the |
| includeTags | A list of tags to use. When specified, only rules with these tags will be processed. |
| inputDirectory |
Specify the path to the directory containing the applications to be analyzed. This argument defaults to |
| keepWorkDirs | Flag to instruct RHAMT to not delete temporary working files, such as the graph database and unzipped archives. This is useful for debugging purposes. |
| packages | A list of the packages to be evaluated by RHAMT. This argument is required. See Select Packages for more information. |
| offlineMode | Flag to operate in offline mode, disabling network access features, such as scheme validation. Used to improve performance. |
| outputDirectory |
Specify the path to the directory to output the report information generated by RHAMT. This argument defaults to |
| overwrite |
Flag to force delete the existing output directory specified by Warning Be careful not to specify a report output directory that contains important information! |
| sourceTechnologies |
A list of one or more source technologies, servers, platforms, or frameworks to migrate from. This argument, in conjunction with the |
| sourceMode |
Flag to indicate that the application to be evaluated contains source files rather than compiled binaries. Defaults to |
| targetTechnologies |
A list of one or more target technologies, servers, platforms, or frameworks to migrate to. This argument, in conjunction with the |
| userIgnorePath | Specify a location for RHAMT to identify files that should be ignored. |
| userRulesDirectory |
Specify a location for RHAMT to look for custom RHAMT rules. The value can be a directory containing ruleset files or a single ruleset file. The ruleset files must use the |
| windupHome | An optional argument that points to the root of an extracted RHAMT CLI. By referencing a local installation of the CLI, the Maven plugin has direct access to all of the indexes, resulting in a performance increase. |
| windupVersion | Specify the version of RHAMT. |
A.1.1. Specify the Input Directory Link kopierenLink in die Zwischenablage kopiert!
A path to the file or directory containing one or more applications to be analyzed. This defaults to {project.basedir}/src/main/.
Usage
<inputDirectory>INPUT_ARCHIVE_OR_DIRECTORY</inputDirectory>
<inputDirectory>INPUT_ARCHIVE_OR_DIRECTORY</inputDirectory>
Depending on whether the input file type provided to the inputDirectory argument is a file or directory, it will be evaluated as follows depending on the additional arguments provided.
- Directory
Expand --explodedApp --sourceMode Neither Argument The directory is evaluated as a single application.
The directory is evaluated as a single application.
Each subdirectory is evaluated as an application.
- File
Expand --explodedApp --sourceMode Neither Argument Argument is ignored; the file is evaluated as a single application.
The file is evaluated as a compressed project.
The file is evaluated as a single application.
A.1.2. Specify the Output Directory Link kopierenLink in die Zwischenablage kopiert!
Specify the path to the directory to output the report information generated by RHAMT.
Usage
<outputDirectory>OUTPUT_REPORT_DIRECTORY</outputDirectory>
<outputDirectory>OUTPUT_REPORT_DIRECTORY</outputDirectory>
-
If omitted, the report will be generated in the
{project.build.directory}/windup-reportdirectory. -
If the output directory exists, it will be overwritten based on the value of the
overwriteargument. This argument defaults totrue, and causes RHAMT to delete and recreate the directory.
A.1.3. Set the Source Technology Link kopierenLink in die Zwischenablage kopiert!
A list of one or more source technologies, servers, platforms, or frameworks to migrate from. This argument, in conjunction with the targetTechnologies argument, helps to determine which rulesets are used.
Usage
<sourceTechnologies>
<source>eap:6</source>
</sourceTechnologies>
<sourceTechnologies>
<source>eap:6</source>
</sourceTechnologies>
The sourceTechnologies argument now provides version support, which follows the Maven version range syntax. This instructs RHAMT to only run the rulesets matching the specified versions. For example, <source>eap:5</source>.
A.1.4. Set the Target Argument Link kopierenLink in die Zwischenablage kopiert!
A list of one or more target technologies, servers, platforms, or frameworks to migrate to. This argument, in conjunction with the sourceTechnologies argument, helps to determine which rulesets are used. This argument is required
Usage
<targetTechnologies> <target>eap:7</target> </targetTechnologies>
<targetTechnologies>
<target>eap:7</target>
</targetTechnologies>
The targetTechnologies argument now provides version support, which follows the Maven version range syntax. This instructs RHAMT to only run the rulesets matching the specified versions. For example, <target>eap:7</target>.
When migrating to JBoss EAP, be sure to specify the version in the target, for example, eap:6. Specifying only eap will run rulesets for all versions of JBoss EAP, including those not relevant to your migration path.
See Supported Migration Paths in the RHAMT Getting Started Guide for which JBoss EAP version is appropriate for your source platform.
A.1.5. Select Packages Link kopierenLink in die Zwischenablage kopiert!
A list of the packages to be evaluated by RHAMT. It is highly recommended to use this argument.
Usage
<packages> <package>PACKAGE_1</package> <package>PACKAGE_2</package> </packages>
<packages>
<package>PACKAGE_1</package>
<package>PACKAGE_2</package>
</packages>
In most cases, you are interested only in evaluating custom application class packages and not standard Java EE or third party packages. The
PACKAGE_Nargument is a package prefix; all subpackages will be scanned. For example, to scan the packagescom.mycustomappandcom.myotherapp, use the following snippet in yourpom.xml.<packages> <package>com.mycustomapp</package> <package>com.myotherapp</package> </packages>
<packages> <package>com.mycustomapp</package> <package>com.myotherapp</package> </packages>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
While you can provide package names for standard Java EE third party software like
org.apache, it is usually best not to include them as they should not impact the migration effort.
A.2. Rule Story Points Link kopierenLink in die Zwischenablage kopiert!
A.2.1. What are Story Points? Link kopierenLink in die Zwischenablage kopiert!
Story points are an abstract metric commonly used in Agile software development to estimate the level of effort needed to implement a feature or change.
Red Hat Application Migration Toolkit uses story points to express the level of effort needed to migrate particular application constructs, and the application as a whole. It does not necessarily translate to man-hours, but the value should be consistent across tasks.
A.2.2. How Story Points are Estimated in Rules Link kopierenLink in die Zwischenablage kopiert!
Estimating the level of effort for the story points for a rule can be tricky. The following are the general guidelines RHAMT uses when estimating the level of effort required for a rule.
| Level of Effort | Story Points | Description |
|---|---|---|
| Information | 0 | An informational warning with very low or no priority for migration. |
| Trivial | 1 | The migration is a trivial change or a simple library swap with no or minimal API changes. |
| Complex | 3 | The changes required for the migration task are complex, but have a documented solution. |
| Redesign | 5 | The migration task requires a redesign or a complete library change, with significant API changes. |
| Rearchitecture | 7 | The migration requires a complete rearchitecture of the component or subsystem. |
| Unknown | 13 | The migration solution is not known and may need a complete rewrite. |
A.2.3. Task Severity Link kopierenLink in die Zwischenablage kopiert!
In addition to the level of effort, you can categorize migration tasks to indicate the severity of the task. The following categories are used to indicate whether a task must be completed or can be postponed.
- Mandatory
- The task must be completed for a successful migration. If the changes are not made, the resulting application will not build or run successfully. Examples include replacement of proprietary APIs that are not supported in the target platform.
- Optional
- If the migration task is not completed, the application should work, but the results may not be the optimal. If the change is not made at the time of migration, it is recommended to put it on the schedule soon after migration is completed. An example of this would be the upgrade of EJB 2.x code to EJB 3.
For more information on categorizing tasks, see Using Custom Rule Categories in the Rules Development Guide.
A.3. Additional Resources Link kopierenLink in die Zwischenablage kopiert!
A.3.1. Get Involved Link kopierenLink in die Zwischenablage kopiert!
To help make Red Hat Application Migration Toolkit cover most application constructs and server configurations, including yours, you can help with any of the following items.
- Send an email to jboss-migration-feedback@redhat.com and let us know what RHAMT migration rules should cover.
- Provide example applications to test migration rules.
Identify application components and problem areas that may be difficult to migrate.
- Write a short description of these problem migration areas.
- Write a brief overview describing how to solve the problem migration areas.
- Try Red Hat Application Migration Toolkit on your application. Be sure to report any issues you encounter.
Contribute to the Red Hat Application Migration Toolkit rules repository.
- Write a Red Hat Application Migration Toolkit rule to identify or automate a migration process.
- Create a test for the new rule.
- Details are provided in the Rules Development Guide.
Contribute to the project source code.
- Create a core rule.
- Improve RHAMT performance or efficiency.
- See the Core Development Guide for information about how to configure your environment and set up the project.
Any level of involvement is greatly appreciated!
A.3.2. Important Links Link kopierenLink in die Zwischenablage kopiert!
- RHAMT forums: https://developer.jboss.org/en/windup
RHAMT JIRA issue trackers
- Core RHAMT: https://issues.jboss.org/browse/WINDUP
- RHAMT Rules: https://issues.jboss.org/browse/WINDUPRULE
- RHAMT mailing list: jboss-migration-feedback@redhat.com
- RHAMT on Twitter: @JBossWindup
-
RHAMT IRC channel: Server FreeNode (
irc.freenode.net), channel#windup(transcripts).
A.3.3. Known RHAMT Issues Link kopierenLink in die Zwischenablage kopiert!
You can review known issues for RHAMT here: Open RHAMT issues.
A.3.4. Report Issues with RHAMT Link kopierenLink in die Zwischenablage kopiert!
Red Hat Application Migration Toolkit uses JIRA as its issue tracking system. If you encounter an issue executing RHAMT, please file a JIRA Issue.
If you do not have one already, you must sign up for a JIRA account in order to create a JIRA issue.
A.3.4.1. Create a JIRA Issue Link kopierenLink in die Zwischenablage kopiert!
Open a browser and navigate to the JIRA Create Issue page.
If you have not yet logged in, click the Log In link at the top right side of the page and enter your credentials.
Choose the following options and click the Next button.
Project
For core RHAMT issues, choose Red Hat Application Migration Toolkit (WINDUP).
For issues with RHAMT rules, choose: Red Hat Application Migration Toolkit rules (WINDUPRULE).
- Issue Type: Bug
On the next screen complete the following fields.
- Summary: Enter a brief description of the problem or issue.
- Environment: Provide the details of your operating system, version of Java, and any other pertinent information.
- Description: Provide a detailed description of the issue. Be sure to include logs and exceptions traces.
- Attachment: If the application or archive causing the issue does not contain sensitive information and you are comfortable sharing it with the RHAMT development team, attach it to the issue using the browse button.
- Click the Create button to create the JIRA issue.