Langsung ke konten
Skillpedia
API & server (backend)40k ยท #7261

java-upgrade

Fungsinya

Membantu Anda memutakhirkan proyek Java ke versi Java yang lebih baru (misalnya dari 11 ke 17). Panduan ini memandu Anda langkah demi langkah agar fitur bahasa dan library yang baru dapat digunakan dengan aman.

Kapan dipakai

  • โœ“Saat Anda ingin memperbarui kode Java ke versi yang lebih baru.
  • โœ“Saat ingin memodernisasi fitur dalam proyek Java Anda.
  • โœ“Saat ingin menggunakan fitur Java baru seperti 'record' atau 'sealed class'.

Link skill

https://github.com/github/awesome-copilot/blob/main/skills/java-upgrade/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/github/awesome-copilot/blob/main/skills/java-upgrade/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin meningkatkan proyek Java saya dari versi 11 ke 17 dan menggunakan fitur-fitur barunya.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

AI akan memeriksa versi Java yang digunakan proyek Anda, lalu memandu Anda melakukan perubahan yang diperlukan, satu versi per tahap. AI juga menyarankan pembaruan pada sistem build, kemudian membantu Anda menerapkan fitur bahasa baru.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Java Upgrade

Help upgrade a Java project step by step and adopt new language features safely.

Need a more powerful, automated upgrade?

The Microsoft plugin modernize-java ("GitHub Copilot modernization - Java Upgrade CLI Plugin", also listed in this repository's plugins/external.json) upgrades Java applications from the command line. It can:

  • analyze the project, assess dependencies and generate a customizable upgrade plan you can review and edit;
  • execute the plan to automatically transform the codebase;
  • fix build issues and resolve migration errors during the upgrade, running test validations;
  • validate the application against known CVEs after the upgrade;
  • output a detailed summary (file changes, updated dependencies, test results, remaining issues) suitable for PRs or CI logs.

This skill provides lightweight, step-by-step guidance and works without the plugin; the plugin is the more powerful option for large or multi-step upgrades. It is a separate Microsoft plugin, not part of this repository's skills. To try it (see the plugin README for the recommended model):

npm install -g @github/copilot
copilot plugin marketplace add microsoft/modernize-java
copilot plugin install modernize-java@modernize-java
copilot --agent modernize-java:modernize-java

Workflow

  1. Detect the current and target versions. Read pom.xml (maven.compiler.release, java.version, toolchains), build.gradle* (java.toolchain, sourceCompatibility) and CI files. Never assume a target: ask the user if it is not stated.
  2. Upgrade one LTS at a time (11 โ†’ 17 โ†’ 21 โ†’ 25). Build and run the tests after each step.
  3. Load only the guide you need from the table below. Do not load all of them.
  4. Update the build first (compiler release, plugins, dependencies that need newer versions), then adopt language features incrementally in small, reviewable changes.
  5. Verify: ./mvnw verify or ./gradlew build, and fix deprecation and removal warnings before adopting new features.
  6. Automate and check upstream. Use OpenRewrite when available (for example org.openrewrite.java.migrate.UpgradeToJava21) and always fetch the version-specific official guide before editing; review the generated diff.

Upstream sources (read before upgrading)

Fetch the page for the target version; prefer it over this skill when they conflict. Full list with build-tool and agent compatibility pages: references/upstream-sources.md.

Per-version guides

Upgrade Guide
Java 11 โ†’ 17 references/java-11-to-17.md
Java 17 โ†’ 21 references/java-17-to-21.md
Java 21 โ†’ 25 references/java-21-to-25.md

Rules

  • Prefer behavior-preserving refactorings; do not change public APIs unless asked.
  • Detect the project's frameworks (Spring Boot, Quarkus, Jakarta EE) and check their minimum supported Java version before raising the target.
  • Do not adopt preview features unless the user opts in and the build enables them explicitly.
  • For javax.* to jakarta.* namespace changes, use the javax-to-jakarta-migration skill if it is installed (gh skills install github/awesome-copilot javax-to-jakarta-migration); otherwise do the migration inline: update imports, META-INF service files and XML descriptors, and bump dependencies to Jakarta EE 9+ equivalents.
  • If the modernize-java plugin is installed and the user wants an automated upgrade, defer to it and use this skill for the per-version guides and the javax to jakarta safeguards.
Pertanyaan umum

Apa perbedaan skill ini dengan plugin 'modernize-java'?

Skill ini menawarkan panduan langkah demi langkah yang lebih sederhana. Plugin 'modernize-java' adalah alat yang lebih canggih untuk peningkatan otomatis dan yang lebih kompleks, dan dapat dipasang secara terpisah.

Apa itu 'record' dan 'sealed class'?

'Record' adalah cara yang lebih sederhana untuk membuat class yang menyimpan data. 'Sealed class' memungkinkan Anda mengontrol class lain mana saja yang boleh mewarisi class tertentu.

Bolehkah saya melewati beberapa versi Java?

Tidak disarankan. AI menyarankan untuk memutakhirkan satu versi mayor pada satu waktu (misalnya dari 11 ke 17, lalu dari 17 ke 21) agar semuanya tetap berjalan dengan benar.

Detail

Deskripsi asli dari pembuat

Upgrade a Java project to a newer JDK (11 to 17, 17 to 21, 21 to 25) and adopt the new language and library features. Detects the current Java version from the build files, then loads only the matching per-version guide. Use when the user asks to upgrade Java, modernize Java code, or adopt records, sealed classes, pattern matching, virtual threads or other new Java features. For automated end-to-e

repo: github/awesome-copilot

Popularitas

Bintang GitHub
40k
Peringkat
#7261
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa