Comprehensive developer toolkit providing reusable skills for Java/Spring Boot, TypeScript/NestJS/React/Next.js, Python, PHP, AWS CloudFormation, AI/RAG, DevOps, and more.
82
82%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Complete guide for building Spring Boot 3.x applications as GraalVM native images with AOT processing.
native-image installedSpring Boot 3.x provides first-class GraalVM Native Image support. The spring-boot-starter-parent includes a native profile with all necessary configurations.
Spring Boot AOT processing generates optimized code at build time that replaces runtime reflection:
What AOT does:
@Conditional annotations at build timeImportant constraints:
@Profile conditions are evaluated during AOT — active profiles must be specified at build time@ConditionalOnProperty is evaluated at build time<!-- Maven -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>process-aot</id>
<configuration>
<profiles>prod</profiles>
</configuration>
</execution>
</executions>
</plugin>// Gradle
tasks.withType<org.springframework.boot.gradle.tasks.aot.ProcessAot>().configureEach {
args("--spring.profiles.active=prod")
}When Spring Boot's automatic hint detection is insufficient, register hints manually:
RuntimeHintsRegistrarimport org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.context.annotation.ImportRuntimeHints;
@ImportRuntimeHints(MyRuntimeHints.class)
@Configuration
public class AppConfig {
// ...
}
public class MyRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
// Register reflection
hints.reflection()
.registerType(MyDto.class,
builder -> builder
.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
MemberCategory.INVOKE_DECLARED_METHODS,
MemberCategory.DECLARED_FIELDS));
// Register resources
hints.resources()
.registerPattern("templates/*.html")
.registerPattern("static/**");
// Register serialization
hints.serialization()
.registerType(MySerializableClass.class);
// Register proxies
hints.proxies()
.registerJdkProxy(MyInterface.class);
}
}@RegisterReflectionForBindingA convenience annotation to register reflection hints for DTOs and data classes:
@RestController
@RegisterReflectionForBinding({UserDto.class, OrderDto.class, AddressDto.class})
public class UserController {
@GetMapping("/users/{id}")
public UserDto getUser(@PathVariable Long id) {
return userService.findById(id);
}
}@ReflectiveMark individual classes for reflection registration:
@Reflective
public class MyDto {
private String name;
private int age;
// getters, setters, constructors
}| Annotation | Purpose |
|---|---|
@RegisterReflectionForBinding | Register DTOs for reflection (constructors, methods, fields) |
@Reflective | Mark a class for reflection registration |
@ImportRuntimeHints | Import a RuntimeHintsRegistrar implementation |
@AotTestAttributes | Provide test attributes during AOT processing |
Beans using @Conditional annotations are evaluated at build time during AOT:
// This works — condition is resolved at build time
@Configuration
@Profile("prod")
public class ProdConfig {
@Bean
public DataSource dataSource() { /* ... */ }
}
// This requires the property to be available at build time
@Configuration
@ConditionalOnProperty(name = "feature.enabled", havingValue = "true")
public class FeatureConfig {
@Bean
public FeatureService featureService() { /* ... */ }
}Best practice: For native images, prefer environment variables over properties for runtime-switchable configuration.
Run JUnit tests in native mode to verify AOT-compiled tests:
# Maven
./mvnw -Pnative test
# Gradle
./gradlew nativeTest# Maven
./mvnw -Pnative spring-boot:process-test-aot
# Gradle
./gradlew processTestAotVerify that runtime hints are correctly registered without building a native image:
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.predicate.RuntimeHintsPredicates;
@Test
void shouldRegisterHints() {
RuntimeHints hints = new RuntimeHints();
new MyRuntimeHints().registerHints(hints, getClass().getClassLoader());
assertThat(RuntimeHintsPredicates.reflection()
.onType(MyDto.class)
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS))
.accepts(hints);
assertThat(RuntimeHintsPredicates.resource()
.forResource("templates/index.html"))
.accepts(hints);
}Build OCI images with Paketo Buildpacks (no local GraalVM installation needed):
# Maven
./mvnw -Pnative spring-boot:build-image \
-Dspring-boot.build-image.imageName=myapp:native
# Gradle
./gradlew bootBuildImage \
--imageName=myapp:nativeConfigure the builder in pom.xml:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-jammy-tiny:latest</builder>
<env>
<BP_NATIVE_IMAGE>true</BP_NATIVE_IMAGE>
<BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
--no-fallback -H:+ReportExceptionStackTraces
</BP_NATIVE_IMAGE_BUILD_ARGUMENTS>
</env>
</image>
</configuration>
</plugin>plugins
developer-kit-ai
skills
chunking-strategy
prompt-engineering
developer-kit-aws
skills
aws
aws-cli-beast
aws-cost-optimization
aws-drawio-architecture-diagrams
aws-sam-bootstrap
aws-cloudformation
aws-cloudformation-auto-scaling
references
aws-cloudformation-bedrock
references
aws-cloudformation-cloudfront
references
aws-cloudformation-cloudwatch
references
aws-cloudformation-dynamodb
references
aws-cloudformation-ec2
aws-cloudformation-ecs
references
aws-cloudformation-elasticache
aws-cloudformation-iam
references
aws-cloudformation-lambda
references
aws-cloudformation-rds
aws-cloudformation-s3
references
aws-cloudformation-security
references
aws-cloudformation-task-ecs-deploy-gh
aws-cloudformation-vpc
developer-kit-core
skills
developer-kit-java
skills
aws-lambda-java-integration
aws-rds-spring-boot-integration
aws-sdk-java-v2-bedrock
aws-sdk-java-v2-core
aws-sdk-java-v2-dynamodb
aws-sdk-java-v2-kms
aws-sdk-java-v2-lambda
aws-sdk-java-v2-messaging
aws-sdk-java-v2-rds
aws-sdk-java-v2-s3
aws-sdk-java-v2-secrets-manager
graalvm-native-image
langchain4j
langchain4j-mcp-server-patterns
langchain4j-ai-services-patterns
references
langchain4j-mcp-server-patterns
references
langchain4j-rag-implementation-patterns
references
langchain4j-spring-boot-integration
langchain4j-testing-strategies
langchain4j-tool-function-calling-patterns
langchain4j-vector-stores-configuration
references
qdrant
references
spring-ai-mcp-server-patterns
references
spring-boot-actuator
spring-boot-cache
spring-boot-crud-patterns
spring-boot-dependency-injection
spring-boot-event-driven-patterns
spring-boot-openapi-documentation
spring-boot-project-creator
spring-boot-resilience4j
spring-boot-rest-api-standards
spring-boot-saga-pattern
spring-boot-security-jwt
assets
references
scripts
spring-boot-test-patterns
spring-data-jpa
references
spring-data-neo4j
references
unit-test-application-events
unit-test-bean-validation
unit-test-boundary-conditions
unit-test-caching
unit-test-config-properties
unit-test-controller-layer
unit-test-exception-handler
unit-test-json-serialization
unit-test-mapper-converter
unit-test-parameterized
unit-test-scheduled-async
unit-test-service-layer
unit-test-utility-methods
unit-test-wiremock-rest-api
developer-kit-php
skills
aws-lambda-php-integration
developer-kit-python
skills
aws-lambda-python-integration
developer-kit-tools
developer-kit-typescript
skills
aws-lambda-typescript-integration
better-auth
drizzle-orm-patterns
dynamodb-toolbox-patterns
references
nestjs
nestjs-best-practices
nestjs-code-review
nestjs-drizzle-crud-generator
scripts
nextjs-app-router
nextjs-authentication
nextjs-code-review
nextjs-data-fetching
references
nextjs-deployment
nextjs-performance
nx-monorepo
react-code-review
react-patterns
references
shadcn-ui
tailwind-css-patterns
references
tailwind-design-system
references
turborepo-monorepo
typescript-docs
typescript-security-review
zod-validation-utilities