From f0d1eb78912eaab63e6e47a9bfb953ac8f08b776 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 18 Oct 2022 15:32:23 +0200 Subject: [PATCH] Configure the Native buildpack when enabling the native Maven profile This commit makes sure that the Native Cloud Native Buildpacks is configured when the native Maven profile is enabled. Doing so lets users generate a native image with a single command-line by default: $ ./mvnw -Pnative spring-boot:build-image Closes gh-32764 --- .../spring-boot-starter-parent/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle index adff4c7529..33b6d45021 100644 --- a/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle +++ b/spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle @@ -236,6 +236,14 @@ publishing.publications.withType(MavenPublication) { 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')