You have hopefully seen our series of blogs about the Migration Toolkit for Application Binaries (binary scanner) but did you know we also have another tool to help you with your application migrations? The WebSphere Application Migration Toolkit (source scanner) analyzes your application source code to find potential issues for a variety of migration scenarios, including WebSphere traditional to Liberty, Java SE migrations, and WebSphere traditional version migrations. It generally runs the same set of rules included with the binary scanner, Transformation Advisor, and Liberty readiness in the WebSphere admin console, but shows you where your application needs updates right in your source code. Where possible, the source scanner even has quick fixes that will make the necessary application updates for you!
Who is it for?
The source scanner is perfect for developers who are making updates to their application source code to get their application working in their target migration environment. You or your administrators may already be using the binary scanner, Transformation Advisor, or the Liberty readiness report in the WebSphere traditional console to evaluate your applications, but the source scanner is a great tool for when you need to make any updates to your application.
How do I install the source scanner?
The source scanner is an Eclipse IDE plugin so if you already use Eclipse as your IDE you just need to install the plugin. Even if you don't generally use Eclipse as your IDE of choice, you can download Eclipse and use it as your IDE when going through a migration effort to take advantage of the source scanner. The steps to install the source scanner are:
- If you don’t already have Eclipse, download and install the latest “Eclipse IDE for Enterprise Java and Web Developers” from https://www.eclipse.org/downloads/packages/.
- Once Eclipse is installed, open the Eclipse Marketplace and search "WebSphere Migration". Select and install the "IBM WebSphere Application Server Migration Toolkit".
- If you aren't already using Eclipse as your IDE, import your source code into Eclipse.
How do I use the source scanner?
The source scanner runs similar to the binary scanner in that there are sets of rules that are run based on your migration scenario. To launch the source scanner:
- Click on Run -> Analysis… -> New launch configuration. Name the configuration and select the scope you would like analyzed (either the entire workspace, individual projects, or working sets).
- Click on the Rules tab, click on the Rule Sets drop-down list, and choose the option for your migration scenario. In this case I am migrating to Liberty so I will choose “WebSphere Application Server Version Migration”. Click the "Set…” button to see the Application Server, Java EE, and Java SE migration target options and select those that are applicable to your migration.
- Click Ok and then Apply. If you want to look at the rules that have been selected you can look through the items selected in the Analysis Domains and Rules list. Although the rules can be selected individually we generally recommend sticking with the predefined rulesets for ease. When ready, click Analyze.
- A Software Analyzer Results tab will be populated with the analysis results. Double click on a result to be taken to the affected code. Open the Help View (go to Window -> Show View -> Other... -> Help) to see additional information and remediation advice for each result.
Example
I have the source code for a JMS sample application that is currently running on WebSphere traditional v9 that I want to migrate to Liberty. During this migration I also want to move to Java EE 8 and Java SE 11, so I select the following migration options:
After running the analysis I see that I have a single rule triggering due to the use of a deprecated WebSphere API that is not available in Liberty. The source scanner shows me exactly where I am using the API and tells me the updates that I need to make.
Can the source scanner make updates for me?
Yes! When possible, the source scanner implements quick fixes that will automatically make the necessary updates for you. You can preview them beforehand to ensure that you understand the updates that will be made. In my case, there is a quick fix available for the code change that I need to make. First I select "Quick Fix Preview" so that I understand the update that the source scanner is going to make.
The comparison screen appears with a preview of the code updates with the old code on the right and the suggested change on the left.
After review the update looks good to me so I am ready to run the Quick Fix. I select Quick Fix and the code update is made. My application is now ready to run on Liberty!
What about the evaluation report?
You might have seen Chuka’s blog about the technology evaluation report in the binary scanner. The same functionality is also available in the source scanner to help you evaluate which Java/Jakarta EE technologies your application is using and which WebSphere Application Servers support those technologies. To view your evaluation report in the source scanner:
Click Run -> Generate Application Technology Evaluation Report. Select the projects you want include in the report and click OK.
You can then view an evaluation report similar to the binary scanner. This helps you understand what technologies your application is using and what products in the WebSphere family support those technologies.
In my case, I want to evaluate which application servers can run my application. I launch the evaluation report on the projects containing my sample JMS application and take a look at the results. The report shows that my application is making use of Servlets, JSPs, and JMS. Based on those technologies I can see that I am able to run my application on my target platform: WebSphere Liberty.
As we’ve seen, the source scanner is a great tool for helping to both analyze your application for potential migration issues as well as help you understand and update your application. Give it a try today!
See the IBM Developer learning path Modernizing applications to use WebSphere Liberty to discover all the application modernization tools available with WebSphere Hybrid Edition.
Also, check out the other articles in this app modernization blog series.