Share via


GitHub Copilot App Modernization - upgrade for Java (preview)

This article provides an overview of GitHub Copilot App Modernization - upgrade for Java (preview).

Enterprises often deal with technical debt throughout their development cycles, and upgrading is a common task. It can require substantial time and resources to upgrade Java runtimes, frameworks, and dependencies.

GitHub Copilot App Modernization - upgrade for Java (preview) is an AI-based solution designed to assist with updating your Java apps. The tool uses AI to perform the following tasks:

  • Analyze the project and its dependencies and propose an upgrade plan.
  • Execute the plan to transform the project.
  • Automatically fix issues during the progress.
  • Report all details including commits, logs, and output.
  • Perform a check for Common Vulnerabilities and Exposures (CVE) security vulnerabilities and code inconsistencies after the upgrade.
  • Show a summary including file changes, updated dependencies, and fixed issues.
  • Generate unit test cases separately from the upgrade process.

The tool integrates GitHub Copilot's AI-powered capabilities with open-source tools like OpenRewrite to automate complex upgrade steps. It supports both Maven and Gradle projects and targets upgrades between Java versions 8, 11, 17, and 21. The tool has a particular focus on modernizing applications that use the Spring Boot framework. The upgrade process keeps you in control and ensures transparency by displaying all logs and outputs.

The following video shows you how to upgrade the version of your Java Spring apps by using GitHub Copilot App Modernization - upgrade for Java (preview):


Common use cases

GitHub Copilot App Modernization - upgrade for Java (preview) can be used for the following use cases.

  • Upgrade Java runtime versions. Seamlessly upgrade your application from Java 8 or 11 to newer versions like Java 17 or 21.
  • Upgrade to a newer framework version. Transition from Spring Boot 2.7 to versions like 3.2 with intelligent handling of breaking changes.
  • Detect CVE vulnerabilities. Detect and resolve known security vulnerabilities in third-party dependencies during the upgrade process.
  • Ensure code behavior consistency. Verify that your application behaves the same post-upgrade by detecting and resolving behavioral inconsistencies.
  • Generate unit test cases for projects that have low test coverage. The unit test generation tool is capable of creating unit test cases independently from the upgrade process.

There's also a separate tool that helps you migrate your apps to Azure. GitHub Copilot App Modernization for Java (preview) is an AI-powered tool that provides code assessment and remediation, and ensures successful builds in one solution, enhancing developer speed, quality, and confidence. For more information, see GitHub Copilot App Modernization for Java (preview).

Concepts

The GitHub Copilot App Modernization - upgrade for Java (preview) follows a guided, multi-phase upgrade workflow within Visual Studio Code. The following sections provide a conceptual model of how the tool operates:

1. Initial prompt

You provide an initial prompt in Visual Studio Code's Agent Mode, such as Upgrade my Java project to Java 17 and Spring Boot 3.2.

2. Project analysis

Based on this prompt, the tool assesses the current Java project's structure in the workspace, including the build tool - Maven or Gradle - JDK versions, and dependencies.

The tool then generates an initial upgrade plan in a plan.md file, which outlines the planned changes.

3. Plan customization

In this step, you can review and edit the upgrade plan to adjust target versions of JDK, frameworks, or third-party libraries. After you confirm the plan, the upgrade starts.

4. Automated code transformation

Here's where the code transformation takes place. This transformation mainly consists of the following two major steps:

  1. The tool first uses an open-source tool called OpenRewrite to apply the code transformation.
  2. If there are any remaining issues, GitHub Copilot then addresses these issues dynamically until there are no more issues.

During this process, the developer can directly see the progress via the progress.md file.

5. Validation

After the previous phase completes, the tool runs additional checks, including the following checks:

  • CVE security vulnerabilities in updated dependencies.
  • Code behavior changes.

The tool automatically attempts to resolve discovered issues and enables you to review and approve fixes.

6. Final verification and summary

When the validation phase is done, the tool runs final checks and presents a final summary. In this phase, the tool performs the following tasks:

  • Rebuilds the project and reruns validation checks.
  • Provides a comprehensive upgrade summary in a summary.md file, including dependency changes, file diffs, and commit logs.

GitHub Copilot App Modernization - upgrade for Java (preview) is designed to empower you by removing much of the manual effort and guesswork from Java upgrades, offering a safer and faster path to modernizing legacy codebases.

Next step

Quickstart: upgrade a Java project with GitHub Copilot App Modernization - upgrade for Java (preview)