
Java Add Graalvm Native Image Support
Add GraalVM native image profiles and plugins to Maven or Gradle Java apps, then iterate compile-fix cycles until native builds succeed per Oracle practices.
Overview
Java Add GraalVM Native Image Support is an agent skill most often used in Build (also Ship, Operate) that adds GraalVM native tooling and iterates until Java apps compile to native executables.
Install
npx skills add https://github.com/github/awesome-copilot --skill java-add-graalvm-native-image-supportWhat is this skill?
- Detects Maven vs Gradle and framework flavor: Spring Boot, Quarkus, Micronaut, or generic Java
- Adds GraalVM Native Build Tools plugin inside a Maven native profile or Gradle equivalent
- Runs native image builds and parses errors/warnings for iterative fixes
- Follows Oracle GraalVM native image best practices for reachability and configuration
- Supports framework-specific native hints until compilation succeeds
- 6-step agent loop: analyze, configure, build, analyze errors, fix, repeat until success
- Supports Maven and Gradle with Spring Boot, Quarkus, Micronaut detection
Adoption & trust: 8.4k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Spring or Quarkus service runs on the JVM but native image setup fails with opaque reflection and classpath errors after the first build.
Who is it for?
Experienced solo backend devs shipping containerized Java APIs who want GraalVM native binaries and can tolerate iterative native-image debugging.
Skip if: Greenfield learners without Maven/Gradle fluency, apps heavy on unsupported dynamic features, or teams with no CI time/RAM for native builds.
When should I use this skill?
You have an existing Java Maven or Gradle project and need GraalVM native image support with iterative build-and-fix until success.
What do I get? / Deliverables
Your project gains a native profile, successful native-image compilation, and applied fixes documented across iterative build cycles.
- Updated pom.xml or Gradle native profile with GraalVM Native Build Tools
- Successful native-image build artifact or documented remaining blockers
- Iterative fixes for reflection, resource, and dependency reachability issues
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Native image configuration is applied while the backend codebase is still being shaped, before production cutover. Primary work is JVM build tooling and reflection/resource metadata on Java services—not frontend or growth analytics.
Where it fits
Add a Maven native profile to a Spring Boot API before containerizing for Fly.io or Railway.
Cut cold-start latency for serverless or knative deployments by finishing a green native-image build in CI.
Re-run native configuration after upgrading Spring Boot or GraalVM to clear new reachability warnings.
How it compares
Iterative native-image specialist—not a one-line Docker tweak or generic Java unit-test skill.
Common Questions / FAQ
Who is java-add-graalvm-native-image-support for?
Java developers on Spring Boot, Quarkus, Micronaut, or generic Maven/Gradle apps who need agent-guided GraalVM native image setup and error resolution.
When should I use java-add-graalvm-native-image-support?
Use during Build when hardening the backend binary story, again in Ship for perf-focused release builds, and in Operate when revisiting native config after dependency upgrades.
Is java-add-graalvm-native-image-support safe to install?
It modifies build files and runs local native compilations; review Prism Security Audits and diff pom.xml or Gradle changes before merging to main.
SKILL.md
READMESKILL.md - Java Add Graalvm Native Image Support
# GraalVM Native Image Agent You are an expert in adding GraalVM native image support to Java applications. Your goal is to: 1. Analyze the project structure and identify the build tool (Maven or Gradle) 2. Detect the framework (Spring Boot, Quarkus, Micronaut, or generic Java) 3. Add appropriate GraalVM native image configuration 4. Build the native image 5. Analyze any build errors or warnings 6. Apply fixes iteratively until the build succeeds ## Your Approach Follow Oracle's best practices for GraalVM native images and use an iterative approach to resolve issues. ### Step 1: Analyze the Project - Check if `pom.xml` exists (Maven) or `build.gradle`/`build.gradle.kts` exists (Gradle) - Identify the framework by checking dependencies: - Spring Boot: `spring-boot-starter` dependencies - Quarkus: `quarkus-` dependencies - Micronaut: `micronaut-` dependencies - Check for existing GraalVM configuration ### Step 2: Add Native Image Support #### For Maven Projects Add the GraalVM Native Build Tools plugin within a `native` profile in `pom.xml`: ```xml <profiles> <profile> <id>native</id> <build> <plugins> <plugin> <groupId>org.graalvm.buildtools</groupId> <artifactId>native-maven-plugin</artifactId> <version>[latest-version]</version> <extensions>true</extensions> <executions> <execution> <id>build-native</id> <goals> <goal>compile-no-fork</goal> </goals> <phase>package</phase> </execution> </executions> <configuration> <imageName>${project.artifactId}</imageName> <mainClass>${main.class}</mainClass> <buildArgs> <buildArg>--no-fallback</buildArg> </buildArgs> </configuration> </plugin> </plugins> </build> </profile> </profiles> ``` For Spring Boot projects, ensure the Spring Boot Maven plugin is in the main build section: ```xml <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> ``` #### For Gradle Projects Add the GraalVM Native Build Tools plugin to `build.gradle`: ```groovy plugins { id 'org.graalvm.buildtools.native' version '[latest-version]' } graalvmNative { binaries { main { imageName = project.name mainClass = application.mainClass.get() buildArgs.add('--no-fallback') } } } ``` Or for Kotlin DSL (`build.gradle.kts`): ```kotlin plugins { id("org.graalvm.buildtools.native") version "[latest-version]" } graalvmNative { binaries { named("main") { imageName.set(project.name) mainClass.set(application.mainClass.get()) buildArgs.add("--no-fallback") } } } ``` ### Step 3: Build the Native Image Run the appropriate build command: **Maven:** ```sh mvn -Pnative native:compile ``` **Gradle:** ```sh ./gradlew nativeCompile ``` **Spring Boot (Maven):** ```sh mvn -Pnative spring-boot:build-image ``` **Quarkus (Maven):** ```sh ./mvnw package -Pnative ``` **Micronaut (Maven):** ```sh ./mvnw package -Dpackaging=native-image ``` ### Step 4: Analyze Build Errors Common issues and solutions: #### Reflection Issues If you see errors about missing reflection configuration, create or update `src/main/resources/META-INF/native-image/reflect-config.json`: ```json [ { "name": "com.example.YourClass", "allDeclaredConstructors": true, "allDeclaredMethods": true, "allDeclaredFields": true } ] ``` #### Resource Access Issues For missing resources, create `src/main