Make sure the 'native' profile can be used in a multi-modules project

This commit updates the 'native' profile so that it provides plugin
management for the plugins involved in building a native image, rather
than forcing their executions.

This commit also update the Maven Plugin reference guide to describe
what the native profile does, and how it can be used in various
scenarios.

Closes gh-33184
This commit is contained in:
Stephane Nicoll
2022-11-21 12:43:52 +01:00
parent 29ee5d2d9a
commit 75b74637f6
6 changed files with 177 additions and 39 deletions

View File

@@ -232,42 +232,44 @@ publishing.publications.withType(MavenPublication) {
profile {
delegate.id("native")
build {
plugins {
plugin {
delegate.groupId('org.springframework.boot')
delegate.artifactId('spring-boot-maven-plugin')
configuration {
image {
delegate.builder("paketobuildpacks/builder:tiny");
env {
delegate.BP_NATIVE_IMAGE("true")
pluginManagement {
plugins {
plugin {
delegate.groupId('org.springframework.boot')
delegate.artifactId('spring-boot-maven-plugin')
configuration {
image {
delegate.builder("paketobuildpacks/builder:tiny");
env {
delegate.BP_NATIVE_IMAGE("true")
}
}
}
executions {
execution {
delegate.id('process-aot')
goals {
delegate.goal('process-aot')
}
}
}
}
executions {
execution {
delegate.id('process-aot')
goals {
delegate.goal('process-aot')
plugin {
delegate.groupId('org.graalvm.buildtools')
delegate.artifactId('native-maven-plugin')
configuration {
delegate.classesDirectory('${project.build.outputDirectory}')
metadataRepository {
delegate.enabled('true')
}
delegate.requiredVersion('22.3')
}
}
}
plugin {
delegate.groupId('org.graalvm.buildtools')
delegate.artifactId('native-maven-plugin')
configuration {
delegate.classesDirectory('${project.build.outputDirectory}')
metadataRepository {
delegate.enabled('true')
}
delegate.requiredVersion('22.3')
}
executions {
execution {
delegate.id('add-reachability-metadata')
goals {
delegate.goal('add-reachability-metadata')
executions {
execution {
delegate.id('add-reachability-metadata')
goals {
delegate.goal('add-reachability-metadata')
}
}
}
}