此内容没有您所选择的语言版本。

Chapter 2. Getting started


2.1. Running the Maven Plugin

The Maven plugin is run by including a reference to the plugin inside your application’s pom.xml file. When the application is built, the Maven plugin is run and generates the reports for analysis.

Prerequisites

  • Java Development Kit (JDK) installed. MTA supports the following JDKs:

    • OpenJDK 11
    • Oracle JDK 11
  • 8 GB RAM
  • macOS installation: the value of maxproc must be 2048 or greater.

Procedure

  1. Add the following <plugin> to your application’s pom.xml file:

    [...]
    <plugin>
        <groupId>org.jboss.windup.plugin</groupId>
        <artifactId>windup-maven-plugin</artifactId>
        <version>5.3.0.Final</version>
        <executions>
            <execution>
                <id>run-windup</id>
                <phase>package</phase>
                <goals>
                    <goal>windup</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <target>eap:7</target> 
    1
    
        </configuration>
    </plugin>
    [...]
    Copy to Clipboard Toggle word wrap
    1
    Specify a migration target. At least one migration target must be supplied within the configuration.
  2. Add --add-modules=java.se to the MAVEN_OPTS environment variable.

    export MAVEN_OPTS=--add-modules=java.se
    Copy to Clipboard Toggle word wrap
  3. Build the project:

    $ mvn clean install
    Copy to Clipboard Toggle word wrap

    You can access the generated reports.

2.2. Running the Maven Plugin with multiple modules

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.

Note

It is strongly recommended to set inherited to false in multi-module projects; otherwise, the Maven plugin will run 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.

  1. Include the following plugin inside the parent project’s pom.xml. The following is a sample pom.xml for a parent module.

    <plugin>
        <groupId>org.jboss.windup.plugin</groupId>
        <artifactId>windup-maven-plugin</artifactId>
        <version>5.3.0.Final</version>
        <inherited>false</inherited>
        <executions>
            <execution>
                <id>run-windup</id>
                <phase>package</phase>
                <goals>
                    <goal>windup</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <input>${project.basedir}</input>
            <target>eap:7</target> 
    1
    
            <windupHome>>/PATH/TO/CLI/<</windupHome>
        </configuration>
    </plugin>
    Copy to Clipboard Toggle word wrap
    1
    Specify a migration target. At least one migration target must be supplied within the configuration.

    This pom.xml file differs from the default in the following attributes:

    • inherited: Defined at the plugin level, this attribute indicates whether or not this configuration should be used in child modules. Set to false for 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 MTA CLI. This attribute is optional, but is recommended as a performance improvement.

      The above example demonstrates a set of recommended arguments.

  2. Build the parent project. During the build process the Maven plugin runs against all children in the project without further configuration.

    $ mvn clean install
    Copy to Clipboard Toggle word wrap
  3. Once completed, you can access the generated reports. This report contains the analysis for the parent and all children.

2.3. Accessing the report

When you run Migration Toolkit for Applications, 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
Copy to Clipboard Toggle word wrap

The output directory contains the following files and subdirectories:

<OUTPUT_REPORT_DIRECTORY>/
├── index.html          // Landing page for the report
├── <EXPORT_FILE>.csv     // Optional export of data in CSV format
├── graph/              // Generated graphs used for indexing
├── reports/            // Generated HTML reports
├── stats/              // Performance statistics
Copy to Clipboard Toggle word wrap

See the Review the reports section of the MTA CLI Guide for information on the MTA reports and how to use them to assess your migration or modernization effort.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat