java-upgrade — GitHub Copilot rule: Java version bumps in Maven
A rule that points Copilot at the java-upgrade skill whenever you change the Java version in Maven or Gradle files. Handy for LTS jumps.
.github/instructions/java-upgrade.instructions.mdWhat java-upgrade does
The rule fires on pom.xml, build.gradle and build.gradle.kts. When a task touches the Java version — compiler release, toolchain or java.version — Copilot reaches for the java-upgrade skill. That skill detects the current version and loads only the guide that matches: 11 → 17, 17 → 21 or 21 → 25.
No skill in the project yet? Install it with gh skills install github/awesome-copilot java-upgrade, or copy skills/java-upgrade/ from the repository. The rule itself only points the way; the skill does the work.
Two constraints sit in the rule text. Move one LTS version at a time and run the full test suite after each step. Before raising the target, check the minimum Java version your frameworks and dependencies support — skip that and the build breaks on a library that never got the memo.
What it helps with
- bump the Java version in
pom.xmlwithout hunting for migration docs - move from Java 17 to 21 without skipping steps
- check whether dependencies allow the next LTS
- split the upgrade into stages with tests after each one
- load the migration guide for your exact version pair only
Example prompts for the agent
- Upgrade this project to Java 21
- Change
java.versioninpom.xmlto 17 - Move the build to Java 25 and check the dependencies
How to install java-upgrade
Manually: put the files in place
.github/instructions/java-upgrade.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.claude/rules/java-upgrade.mdThe paths frontmatter field limits the files: move applyTo from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/java-upgrade.mdcFrontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own
Manually: put the files in place
.devin/rules/java-upgrade.mdManually: put the files in place
.clinerules/java-upgrade.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about java-upgrade
How do I install java-upgrade in GitHub Copilot?
Drop .github/instructions/java-upgrade.instructions.md into the project — the rule is picked up through its applyTo paths. The skill itself installs with gh skills install github/awesome-copilot java-upgrade.
What does java-upgrade do?
It tells Copilot to use the java-upgrade skill when a task changes the Java version in Maven or Gradle files. The skill detects the current version and loads the matching migration guide.
Which version jumps are covered?
The skill loads a guide per pair: Java 11 → 17, 17 → 21 or 21 → 25. The advice is one LTS at a time, with the test suite run after each step.
Source text
java-upgrade.instructions.md · MIT
--- description: 'Pointer to the java-upgrade skill when changing the Java version in Maven or Gradle build files' applyTo: '**/pom.xml, **/build.gradle, **/build.gradle.kts' --- # Java Version Upgrades When the task changes the Java version of this project (compiler release, toolchain, `java.version`), use the `java-upgrade` skill. It detects the current version and loads only the matching guide for Java 11 → 17, 17 → 21 or 21 → 25. If the skill is not installed, install it with `gh skills install github/awesome-copilot java-upgrade` or copy `skills/java-upgrade/` from this repository. - Upgrade one LTS version at a time and run the full test suite after each step. - Check the minimum Java version supported by the project's frameworks and dependencies before raising the target.
© github · MIT · github/awesome-copilot