WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Automated Fixes in the Migration Toolkit for Application Binaries

By Anu Ramamoorthy posted Wed December 13, 2023 09:37 AM

  

The Migration Toolkit for Application Binaries (binary scanner) is a command-line tool for analyzing application binaries. The binary scanner produces a comprehensive report on how an application can be migrated to another Java SE version, Java EE version, or application platform. Starting with the 23.0.0.4 release we have automated fixes for several of the migration paths available. These include Java SE 6-17, Java/Jakarta EE 7-10 and tWAS to Liberty.  

The Detailed Migration Analysis Report provides instructions on performing application analysis and reviewing the several available rules with automated fixes. The report also provides the Automated Fix Configuration section that contains the config of all supported automated fixes. These include over 40 automated fixes covering several versions of Java in addition to the many existing WebSphere Liberty.

Refer to the "User-defined Rules in the Migration Toolkit for Application Binaries" blog to understand more about how to use user-defined rules.

About automated fixes

Rules with an automated fix can be identified in the Application Migration Details report with the icon along with their description.

Each rule with an automated fix links users to the Automated Configuration section. The generated automated fix configuration can be run through Maven or Gradle build invocations, depending on the user's preferred platform. See the tables at the end for all available automated fixes.

How to run automated fixes against your application?

To run automated fixes against your application first run the binary scanner with the following parameters:

java -jar wamt/binaryAppScanner.jar  TestBinary.war --analyze

This will create a detailed Migration Analysis Report.  Here is an example report:

On selecting “Show  rule help” the user will see the following with the details about the Rule:

On clicking the custom configuration link, users will be navigated to the Automated Fix Configuration section.

Users should see the configuration for their Maven or Gradle build environments to automate the fixes

Here is an example of the section:

Based on the build environment the user can run the configuration to update the class.

Here is an example of a class that gets flagged and modified by the recipe:


Run - mvn rewrite:run

In the terminal, the user should see the active automated fixes and the classes that were modified


The class is automatically modified:


Benefits of automated fixes

This new feature in the WebSphere Application Migration Toolkit for Application Binaries opens many possibilities for the end user. 

The user doesn’t need to make manual fixes for issues covered by a recipe. This enables easy migrations to new versions of Java or Liberty without having to update them.

The fixes can be used from Maven or Gradle and do not require an IDE

The automated fix uses open-source technology that several vendors are now using.

See the IBM Developer learning path Modernizing applications to use WebSphere Liberty to discover all the application modernization tools available with WebSphere Hybrid Edition.  

Available automated fixes

0 comments
166 views

Permalink