build-native-image-maven
하는 일
이 스킬은 Java 개발자가 Maven 프로젝트를 빠르게 시작되는 네이티브 프로그램으로 바꾸도록 돕습니다. 더 가볍고 빠른 Java 앱을 원하는 팀을 위한 스킬입니다.
사용하는 경우
- ✓Maven으로 Java 앱을 GraalVM 네이티브 이미지로 빌드하고 싶을 때.
- ✓pom.xml 파일에 native-maven-plugin을 추가해야 할 때.
- ✓네이티브 이미지 빌드가 실패해 메타데이터를 수집하거나 런타임 문제를 고쳐야 할 때.
스킬 링크
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/assets/skills/build-native-image-maven/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Java 앱을 네이티브 이미지로 빌드할 수 있도록 Maven pom.xml에 native 프로필을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
pom.xml에 native-maven-plugin이 있는 native 프로필을 추가하고, Maven wrapper로 빌드합니다. 플러그인이 native-image 도구를 찾도록 JAVA_HOME을 GraalVM JDK로 설정합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Maven Native Image Build
Prerequisites
- Set
JAVA_HOMEto a GraalVM JDK installation so the plugin can findnative-image. - Do not require
GRAALVM_HOMEin the normal case. Only mention it if the user already relies on it or their environment needs an explicit override. - Use Maven 3.6+.
Plugin Setup
Add the following to your pom.xml inside a native profile:
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.11.1</version>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>test-native</id>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
<configuration>
<mainClass>org.example.Main</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Build and Run
./mvnw -Pnative package # Build native image → target/<imageName>
./target/myapp # Run the native executable
./mvnw -Pnative test # Build and run JUnit tests as a native image
./mvnw -Pnative -DskipTests package # Skip all tests
./mvnw -Pnative -DskipNativeTests package # Run JVM tests only, skip native
Plugin Not Resolving or Activating
- "Could not resolve artifact" — Ensure
mavenCentral()is in repositories and the version is correct. - "Could not find goal 'compile-no-fork'" — Verify
<extensions>true</extensions>is set on the plugin. - Build runs without native compilation — Check you are activating the profile:
./mvnw -Pnative package.
Build or Runtime Failures
For class initialization errors, linking issues, memory problems, or unexpected runtime behavior, see references/maven-plugin-options.md.
Missing Reachability Metadata
When native-image reports missing reflection, resources, serialization, or JNI entries, see references/reachability-metadata.md.
Native Testing
For nativeTest failures or setting up native JUnit tests, see references/testing.md.
Reference Files
| Topic | File |
|---|---|
| Plugin configuration options | references/maven-plugin-options.md |
| Missing reachability metadata | references/reachability-metadata.md |
| Native testing | references/testing.md |
자주 묻는 질문
어떤 Maven 버전이 필요한가요?
Maven 3.6 이상입니다.
GRAALVM_HOME을 쓰나요?
보통 쓰지 않습니다. JAVA_HOME에 의존하며, 이미 쓰고 있는 경우에만 GRAALVM_HOME을 언급합니다.
네이티브 테스트를 실행할 수 있나요?
네. 네이티브 JUnit 테스트를 위한 test-native 실행을 설정합니다.
상세 정보
작성자의 원본 설명
Build GraalVM native images using the native-maven-plugin (org.graalvm.buildtools). Use this skill to build Java applications with Maven, configure pom.xml native image settings, run native tests, collect metadata, or resolve build or runtime issues.
repo: oracle/graal
인기도
- GitHub 스타
- 22k
- 순위
- #10357
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
build-native-image-gradle
22k에이전트가 Gradle로 Java 앱을 빠른 GraalVM 네이티브 이미지로 빌드하고, 흔한 빌드 또는 실행 문제를 고치도록 돕습니다.
building-native-image
22k에이전트가 GraalVM Native Image로 Java 프로그램을 빠른 독립 실행 앱으로 만들고, 흔한 빌드와 실행 오류를 고치도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.