Skip to content

Commit 35e06df

Browse files
committed
imported appmod articles from java-docs-pr
1 parent f5b9159 commit 35e06df

27 files changed

Lines changed: 510 additions & 11 deletions
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Configure Settings to Optimize GitHub Copilot App Modernization for IntelliJ
3+
description: Learn how to configure GitHub Copilot app modernization to optimize the experience for IntelliJ.
4+
author: KarlErickson
5+
ms.author: karler
6+
ms.reviewer: xinrzhu
7+
ms.topic: how-to
8+
ms.date: 10/28/2025
9+
ms.custom: devx-track-java
10+
---
11+
12+
# Configure settings for GitHub Copilot app modernization to optimize the experience for IntelliJ
13+
14+
This article shows you how to configure GitHub Copilot app modernization on IntelliJ to optimize the experience. Because app modernization relies on Model Context Protocol (MCP) tools, these adjustments are useful to ensure smoother execution.
15+
16+
## Enable auto-approve in MCP sampling
17+
18+
Enabling auto-approve helps prevent repeated approval prompts during the upgrade process. Use the following steps:
19+
20+
1. In IntelliJ, go to **GitHub Copilot > Model Context Protocol (MCP)**. Then, under **Auto Approve for Sampling**, select **Configure**.
21+
22+
:::image type="content" source="media/configure-settings-intellij/auto-approve-configure.png" alt-text="Screenshot of IntelliJ that shows the MCP settings." lightbox="media/configure-settings-intellij/auto-approve-configure.png":::
23+
24+
1. Locate **java-upgrade** and then select **Auto Approve**.
25+
26+
:::image type="content" source="media/configure-settings-intellij/auto-approve.png" alt-text="Screenshot of IntelliJ that shows the MCP Sampling Auto-approval settings." lightbox="media/configure-settings-intellij/auto-approve.png":::
27+
28+
## Enable Claude Sonnet 4 model access in MCP sampling
29+
30+
For optimal upgrade results, we recommend enabling access to the **Claude Sonnet 4** model (or newer). Use the following steps to configure model access:
31+
32+
1. In the chat window, select **Configure tools**.
33+
34+
:::image type="content" source="media/configure-settings-intellij/model-tools.png" alt-text="Screenshot of IntelliJ showing Agent Mode, model selector, and tool selector." lightbox="media/configure-settings-intellij/model-tools.png":::
35+
36+
1. Find **java-upgrade** and then select **Configure Model Access**.
37+
38+
:::image type="content" source="media/configure-settings-intellij/configure-model-access.png" alt-text="Screenshot of IntelliJ configuring tools" lightbox="media/configure-settings-intellij/configure-model-access.png":::
39+
40+
1. Ensure that **Claude Sonnet 4** (or a newer model) is selected.
41+
42+
:::image type="content" source="media/configure-settings-intellij/select-models.png" alt-text="Screenshot of IntelliJ selecting models" lightbox="media/configure-settings-intellij/select-models.png":::
43+
44+
## Increase maximum requests to 100
45+
46+
Because app modernization tasks can be long-running, it's best to increase the **maximum requests per turn** in Agent Mode from the default of 25 to **100**. You can adjust this setting directly in the **GitHub Copilot settings**.
47+
48+
:::image type="content" source="media/configure-settings-intellij/max-request.png" alt-text="Screenshot of IntelliJ showing GitHub Copilot settings with max request configuration" lightbox="media/configure-settings-intellij/max-request.png":::
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: Customize the Java Project Upgrade Plan When Using GitHub Copilot App Modernization
3+
description: Describes how to customize the upgrade plan generated by GitHub Copilot app modernization.
4+
author: KarlErickson
5+
ms.author: karler
6+
ms.reviewer: xinrzhu
7+
ms.topic: how-to
8+
ms.date: 11/18/2025
9+
ms.custom: devx-track-java
10+
---
11+
12+
# Customize the Java project upgrade plan when using GitHub Copilot app modernization
13+
14+
This article describes how to customize the Java project upgrade plan generated by GitHub Copilot app modernization.
15+
16+
When you initiate an upgrade session, GitHub Copilot generates a **plan.md** file that outlines the steps and tasks required for the upgrade. This file serves as a blueprint for the upgrade process, which you can customize to better fit your project's needs.
17+
18+
After the tool generates the **plan.md** file, it automatically opens in the Visual Studio Code editor. At this stage, you can review and customize the plan to ensure it aligns with your specific upgrade goals.
19+
20+
## Example plan.md file structure
21+
22+
The following sections describe a sample **plan.md** file structure in order to illustrate the customization points.
23+
24+
## Key parameters
25+
26+
The following sections describe key parameters in the plan that you can modify.
27+
28+
### Build tool command option
29+
30+
This option is located under **Project Information**, and enables you to define custom command-line parameters for build tool execution. For valid options, see the [Maven CLI](https://maven.apache.org/ref/current/maven-embedder/cli.html) or [Gradle CLI](https://docs.gradle.org/current/userguide/command_line_interface.html) documentation, depending on your project.
31+
32+
Examples:
33+
34+
- **For Maven**: `Build tool command options: -Dmaven.javadoc.skip=true -s "/path/to/custom/settings.xml"`
35+
36+
- **For Gradle**: `Build tool command options: --info -Penv=production`
37+
38+
> [!NOTE]
39+
> Replace the path with your actual `settings` file location as needed. This path shown is just an example.
40+
41+
:::image type="content" source="media/customize-upgrade-plan/upgrade-plan.png" alt-text="Screenshot of Visual Studio Code that shows an example upgrade plan with upgrade targets highlighted." lightbox="media/customize-upgrade-plan/upgrade-plan.png":::
42+
43+
### Test validation
44+
45+
Located under the **Additional Tasks** section, you can enable or disable test execution by modifying the `run tests before and after the upgrade` flag.
46+
47+
- Set to `true` to enable unit tests before and after upgrade.
48+
- Set to `false` to skip test validation.
49+
50+
This setting controls whether the tool runs unit tests to verify functional correctness during the upgrade.
51+
52+
By adjusting these settings, you can fine-tune the upgrade process to better suit your project's requirements.
53+
54+
## Customize upgrade goals and provide guidelines
55+
56+
In Java upgrade scenarios, you often need customization beyond standard JDK or framework upgrades - for example, to apply project-specific code changes or to update internal libraries the tool doesn't automatically detect. To support these needs, GitHub Copilot app modernization now enables customization within the upgrade plan. This capability enables you to provide your own recipes, instructions, and inputs to guide the upgrade process. You can perform this customization by modifying the **Upgrade Goals** and **Guidelines** sections.
57+
58+
### The Upgrade Goals section
59+
60+
In the **Upgrade Goals** section, you can now specify more upgrade targets along with the objectives in your initial prompt. For example, if the primary task is to upgrade the project from Java 17 to Java 21, but the project also requires upgrading Log4j from 1.x to 2.x, you can list that as an additional goal, as shown in the following example prompt:
61+
62+
```prompt
63+
## Upgrade Goals
64+
- Upgrade from Java 17 to 21
65+
- Upgrade org.apache.logging.log4j:* to 2.24.3
66+
- Upgrade org.internal.lib to 2.0
67+
```
68+
69+
### The Guidelines section
70+
71+
The **Guidelines** section defines how Copilot should perform the upgrade. While the **Upgrade Goals** section focuses on what needs to be upgraded, the **Guidelines** section captures the methodology, conventions, tooling, and rules that guide Copilot's behavior during code transformation.
72+
73+
You can include any instructions that help steer how Copilot modifies code, such as the following instructions:
74+
75+
- Guidance on which tools, recipes, or frameworks to use for code changes.
76+
- Constraints or prohibitions on certain upgrade approaches.
77+
- Code style or convention requirements.
78+
- Links to internal files, documentation, or scripts the agent can access.
79+
- Domain knowledge helpful for fixing errors or performing upgrades.
80+
- Requirements for how the agent should annotate or comment on code changes.
81+
- Cleanup instructions for temporary artifacts created during the upgrade process.
82+
83+
The content of this section can be plain text, hyperlinks, or references to local files as long as Copilot can access them.
84+
85+
Examples:
86+
87+
```prompt
88+
## Guidelines
89+
- Do not use Log4j 1 to Log4J 2 API bridge to upgrade to Log4J 2.
90+
- Please follow the code conventions defined in /xxx/bbb/rules.txt.
91+
- Please provide detailed comments explaining why each code change is necessary.
92+
- "com.example:internal-lib:2.0.0" is compatible with Java 21.
93+
- Use our internal MCP tool get_internal_lib_knowledge to retrieve compatibility information for internal libraries.
94+
- After the upgrade, please remove any temporary files created during the process, such as code modification scripts.
95+
96+
```
97+
98+
:::image type="content" source="media/customize-upgrade-plan/guidelines.png" alt-text="Screenshot of Java upgrade plan that contains the Upgrade Goals and Guidelines sections." lightbox="media/customize-upgrade-plan/guidelines.png":::
99+
100+
## See also
101+
102+
[GitHub Copilot app modernization](/azure/developer/java/migration/migrate-github-copilot-app-modernization-for-java?toc=/java/upgrade/toc.json&bc=/java/upgrade/breadcrumb/toc.json)
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Upgrade a Java Framework or Third-Party Dependency by Using GitHub Copilot App Modernization
3+
description: Shows you how to use GitHub Copilot app modernization to upgrade a framework or third-party dependency without requiring a JDK runtime upgrade.
4+
author: KarlErickson
5+
ms.author: karler
6+
ms.reviewer: xinrzhu
7+
ms.topic: how-to
8+
ms.date: 09/23/2025
9+
ms.custom: devx-track-java
10+
---
11+
12+
# Upgrade a Java framework or third-party dependency by using GitHub Copilot app modernization
13+
14+
This article shows you how to use GitHub Copilot app modernization to upgrade a Java framework or third-party dependency without requiring a JDK runtime upgrade.
15+
16+
## Initiate a framework upgrade
17+
18+
To initiate this type of upgrade, you can start a prompt in agent mode. For example:
19+
20+
```prompt
21+
upgrade this Java project to Spring Boot 3.2
22+
```
23+
24+
:::image type="content" source="media/framework-upgrade/upgrade-spring-boot-only.png" alt-text="Screenshot of Visual Studio Code that shows Copilot trying to upgrade to Spring Boot 3.2 only." lightbox="media/framework-upgrade/upgrade-spring-boot-only.png":::
25+
26+
## Handle compatibility
27+
28+
If your current JDK version is compatible with the specified Spring Boot version - for example, JDK 17+ for Spring Boot 3.2 - the tool performs a framework-only upgrade. Both the source and target JDK versions remain the same and the target Spring Boot version is set according to your initial prompt.
29+
30+
If your current JDK version isn't compatible with the target framework version - for example, when upgrading from JDK 8 to Spring Boot 3.2 - the tool automatically upgrades the JDK to the minimum supported version required by the framework - in this case, JDK 17 - in addition to performing the framework upgrade.
31+
32+
## Upgrade third-party libraries
33+
34+
You can also use a similar prompt to upgrade a third-party library. For example:
35+
36+
```prompt
37+
use the java upgrade tools to upgrade "com.google.inject.guice" to 6.0.0 in this java project
38+
```
39+
40+
:::image type="content" source="media/framework-upgrade/upgrade-library-only.png" alt-text="Screenshot of Visual Studio Code that shows Copilot trying to upgrade a Google library to a newer version." lightbox="media/framework-upgrade/upgrade-library-only.png":::
41+
42+
When you initiate a prompt to upgrade a specific third-party library - for example, `Upgrade com.google.inject.guide to version 3.17.0` - GitHub Copilot analyzes the current project and generates an upgrade plan focused solely on updating the requested dependency.
43+
44+
## What Copilot does during the upgrade
45+
46+
As part of this process, Copilot might perform the following tasks:
47+
48+
- Modify code or configuration files to ensure compatibility with the new library version.
49+
- Perform build validation to confirm the project compiles successfully.
50+
- Run CVE checks to detect and surface any security issues.
51+
- Execute test validation to ensure no new test failures are introduced.
52+
53+
This *targeted upgrade flow* enables you to modernize dependencies with transparency and control.
54+
55+
## See also
56+
57+
[GitHub Copilot app modernization](/azure/developer/java/migration/migrate-github-copilot-app-modernization-for-java?toc=/java/upgrade/toc.json&bc=/java/upgrade/breadcrumb/toc.json)

‎articles/github-copilot-app-modernization/index.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ landingContent:
3333
- linkListType: quickstart
3434
links:
3535
- text: "Quickstart: Upgrade a Java project"
36-
url: /java/upgrade/quickstart-upgrade?toc=/azure/developer/github-copilot-app-modernization/toc.json&bc=/azure/developer/github-copilot-app-modernization/breadcrumb/toc.json
36+
url: quickstart-upgrade.md
3737
- text: "Quickstart: Generate unit tests"
38-
url: /java/upgrade/quickstart-unit-tests?toc=/azure/developer/github-copilot-app-modernization/toc.json&bc=/azure/developer/github-copilot-app-modernization/breadcrumb/toc.json
38+
url: quickstart-unit-tests.md
3939
- linkListType: how-to-guide
4040
links:
4141
- text: Configure settings for IntelliJ
42-
url: /java/upgrade/configure-settings-intellij?toc=/azure/developer/github-copilot-app-modernization/toc.json&bc=/azure/developer/github-copilot-app-modernization/breadcrumb/toc.json
42+
url: configure-settings-intellij.md
4343
- text: Customize the upgrade plan
44-
url: /java/upgrade/customize-upgrade-plan?toc=/azure/developer/github-copilot-app-modernization/toc.json&bc=/azure/developer/github-copilot-app-modernization/breadcrumb/toc.json
44+
url: customize-upgrade-plan.md
4545
- text: Upgrade a framework or third-party dependency
46-
url: /java/upgrade/framework-upgrade?toc=/azure/developer/github-copilot-app-modernization/toc.json&bc=/azure/developer/github-copilot-app-modernization/breadcrumb/toc.json
46+
url: framework-upgrade.md
4747
- title: Migrate Java projects to Azure
4848
linkLists:
4949
- linkListType: reference
97.9 KB
Loading
20.2 KB
Loading
298 KB
Loading
277 KB
Loading
30.7 KB
Loading
73.3 KB
Loading

0 commit comments

Comments
 (0)