Edit your settings.gradle
file to include the Micronaut Gradle Plugin branch:
plugins {
id 'me.champeau.includegit' version '0.1.4'
}
rootProject.name="micronautguide"
gitRepositories {
include('micronaut-gradle-plugin') {
uri = 'git@github.com:micronaut-projects/micronaut-gradle-plugin.git'
branch = 'cc/aot-support-micronaut-library'
}
}
- edit your
build.gradle
file to include the AOT plugin:
plugins {
id("io.micronaut.library") version "3.1.1-SNAPSHOT"
id("com.github.johnrengelman.shadow") version "7.1.0"
id("io.micronaut.aot") version "3.1.1-SNAPSHOT"
}
micronaut {
aot {
cacheEnvironment.set(true)
optimizeServiceLoading.set(true)
optimizeClassLoading.set(true)
convertYamlToJava.set(true)
precomputeOperations.set(true)
}
}
-
run
./gradlew optimizedJitJar
(oroptimizedJitJarAll
if you are using the shadow plugin) -
profit!