Running the {CLINameTitle}

You can run {ProductShortName} against your application.

Procedure
  1. Open a terminal and navigate to the <{ProductShortName}_HOME>/bin/ directory.

  2. Run the {LC_PSN}-cli script, or {LC_PSN}-cli.bat for Windows, and specify the appropriate arguments:

    $ ./{LC_PSN}-cli --input /path/to/jee-example-app-1.0.0.ear \
    --output /path/to/output --source weblogic --target eap:6 \
    --packages com.acme org.apache
    • --input: The application to be evaluated.

    • --output: The output directory for the generated reports.

    • --source: The source technology for the application migration.

    • --target: The target technology for the application migration.

    • --packages: The packages to be evaluated. This argument is highly recommended to improve performance.

  3. Access the report.

{ProductShortName} command examples

Running {ProductShortName} on an application archive

The following command analyzes the com.acme and org.apache packages of the jee-example-app-1.0.0.ear example EAR archive for migrating from JBoss EAP 5 to JBoss EAP 7:

$ <{ProductShortName}_HOME>/bin/{LC_PSN}-cli \
--input /path/to/jee-example-app-1.0.0.ear \
--output /path/to/report-output/ --source eap:5 --target eap:7 \
--packages com.acme org.apache

Running {ProductShortName} on source code

The following command analyzes the org.jboss.seam packages of the seam-booking-5.2 example source code for migrating to JBoss EAP 6.

$ <{ProductShortName}_HOME>/bin/{LC_PSN}-cli --sourceMode --input /path/to/seam-booking-5.2/ \
--output /path/to/report-output/ --target eap:6 --packages org.jboss.seam

Running cloud-readiness rules

The following command analyzes the com.acme and org.apache packages of the jee-example-app-1.0.0.ear example EAR archive for migrating to JBoss EAP 7. It also evaluates for cloud readiness:

$ <{ProductShortName}_HOME>/bin/{LC_PSN}-cli --input /path/to/jee-example-app-1.0.0.ear \
 --output /path/to/report-output/ \
 --target eap:7 --target cloud-readiness --packages com.acme org.apache

Overriding {ProductShortName} properties

To override the default Fernflower decompiler, pass the -Dwindup.decompiler argument on the command line. For example, to use the Procyon decompiler, use the following syntax:

$ <{ProductShortName}_HOME>/bin/windup-cli -Dwindup.decompiler=procyon --input \
<INPUT_ARCHIVE_OR_DIRECTORY> --output <OUTPUT_REPORT_DIRECTORY> \
--target <TARGET_TECHNOLOGY> --packages <PACKAGE_1> <PACKAGE_2>

Refactoring source code using OpenRewrite

OpenRewrite uses recipes to automate large-scale, distributed source code refactoring. It can be used with the {ProductShortName}.

The first OpenRewrite recipe, which is shipped with {ProductShortName} 5.2.1, renames imported javax packages to their jakarta equivalents.

You can use OpenRewrite in the {ProductShortName} CLI to prepare Java applications for migration.

Procedure
  1. Add the openrewrite argument when you execute the '{LC_PSN}-cli' script and specify the other arguments appropriately:

    ./{LC_PSN}-cli --openrewrite
    "-DactiveRecipes=<recipe name>" --input
    /path/to/source/project --goal dryRun
    • --openrewrite: Flag specifying to run an OpenRewrite migration, instead of an {ProductShortName} analysis.

    • "-DactiveRecipes=org.<recipe name>" : The OpenRewrite recipe to apply to the input project. JavaxtoJakarta is the default shipped recipe but you can add your own to the shipped rewrite.yml and run that recipe instead. The rewrite.yml file is located in the rules/openrewrite/ folder in the uncompressed {ProductShortName} distribution.

    • --input: The application to be evaluated.

    • --goal: Optional. The OpenRewrite maven goal to run. Parameters:

      • dryRun : The script returns a list of proposed changes, creates a patch file which can be applied later, and returns the following message:

        Run 'mvn rewrite:run' to apply the recipes.
      • run: The script makes all changes automatically without listing them first.

        If you do not enter a parameter for goal, the script executes it as dryRun.

  2. To apply the recipe, run the command using the run parameter for the 'goal' argument:

    ./{LC_PSN}-cli --openrewrite
    "-DactiveRecipes=<recipe name>" --input
    /path/to/source/project --goal run
Important

OpenRewrite recipe support is provided as Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

See Technology Preview features support scope on the Red Hat Customer Portal for information about the support scope for Technology Preview features.

{ProductShortName} {CLINameTitle} Bash completion

The {ProductShortName} {CLIName} provides an option to enable Bash completion for Linux systems, allowing the {ProductShortName} command-line arguments to be auto completed by pressing the Tab key when entering the commands. For instance, when Bash completion is enabled, entering the following displays a list of available arguments.

$ <{ProductShortName}_HOME>/bin/windup-cli [TAB]

Enabling Bash completion

To enable Bash completion for the current shell, run the following command:

$ source <{ProductShortName}_HOME>/bash-completion/{LC_PSN}-cli

Enabling persistent Bash completion

The following commands allow Bash completion to persist across restarts:

  • To enable Bash completion for a specific user across system restarts, include the following line in that user’s ~/.bashrc file.

    source <{ProductShortName}_HOME>/bash-completion/{LC_PSN}-cli
  • To enable Bash completion for all users across system restarts, copy the {ProductName} {CLIName} Bash completion file to the /etc/bash_completion.d/ directory as the root user.

    # cp <{ProductShortName}_HOME>/bash-completion/{LC_PSN}-cli /etc/bash_completion.d/

Accessing {ProductShortName} help

To see the complete list of available arguments for the {LC_PSN}-cli command, open a terminal, navigate to the <{ProductShortName}_HOME> directory, and run the following command:

$ <{ProductShortName}_HOME>/bin/{LC_PSN}-cli --help