Native image compilation, reflection configuration, and build optimization.
# Maven with Spring Boot
./mvnw -Pnative native:compile
# Maven with Quarkus
./mvnw package -Dnative
# Gradle
./gradlew nativeCompile
// Quarkus - register for reflection
@RegisterForReflection
public class User {
private String name;
private String email;
}
// Spring Boot - hints
@Configuration
@ImportRuntimeHints(MyRuntimeHints.class)
public class NativeConfig {}
public class MyRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.reflection().registerType(User.class,
MemberCategory.PUBLIC_FIELDS,
MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS,
MemberCategory.INVOKE_PUBLIC_METHODS);
}
}
src/main/resources/META-INF/native-image/
├── reflect-config.json
├── resource-config.json
├── serialization-config.json
└── native-image.properties
// reflect-config.json
[
{
"name": "com.example.User",
"allDeclaredConstructors": true,
"allPublicMethods": true,
"allDeclaredFields": true
}
]
// resource-config.json
{
"resources": {
"includes": [
{"pattern": "application\\.yml"},
{"pattern": "db/migration/.*"}
]
}
}
// Use build-time initialization
@BuildTimeInit
public class Constants {
public static final Map<String, String> CONFIG = loadConfig();
}
// Avoid runtime class loading
// DON'T: Class.forName("com.example.MyClass")
// DO: Reference classes directly
// Use static configuration
// Avoid dynamic proxies when possible
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer