Skip to content

Commit d1e7c9b

Browse files
committed
Introduce 'nativeTest' maven profile
Update `spring-boot-start-parent` with a new `nativeTest` profile. When active, this profile will trigger AOT processing of test code and call the native build tools 'test' goal. Closes gh-32383
1 parent 41e0bbf commit d1e7c9b

File tree

1 file changed

+42
-12
lines changed
  • spring-boot-project/spring-boot-starters/spring-boot-starter-parent

1 file changed

+42
-12
lines changed

spring-boot-project/spring-boot-starters/spring-boot-starter-parent/build.gradle

+42-12
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ publishing.publications.withType(MavenPublication) {
135135
plugin {
136136
delegate.groupId('org.graalvm.buildtools')
137137
delegate.artifactId('native-maven-plugin')
138-
configuration {
139-
delegate.extensions('true')
140-
}
138+
delegate.extensions('true')
141139
}
142140
plugin {
143141
delegate.groupId('io.github.git-commit-id')
@@ -233,6 +231,43 @@ publishing.publications.withType(MavenPublication) {
233231
profiles {
234232
profile {
235233
delegate.id("native")
234+
build {
235+
plugins {
236+
plugin {
237+
delegate.groupId('org.springframework.boot')
238+
delegate.artifactId('spring-boot-maven-plugin')
239+
executions {
240+
execution {
241+
delegate.id('process-aot')
242+
goals {
243+
delegate.goal('process-aot')
244+
}
245+
}
246+
}
247+
}
248+
plugin {
249+
delegate.groupId('org.graalvm.buildtools')
250+
delegate.artifactId('native-maven-plugin')
251+
configuration {
252+
delegate.classesDirectory('${project.build.outputDirectory}')
253+
metadataRepository {
254+
delegate.enabled('true')
255+
}
256+
}
257+
executions {
258+
execution {
259+
delegate.id('native-build')
260+
goals {
261+
delegate.goal('build')
262+
}
263+
}
264+
}
265+
}
266+
}
267+
}
268+
}
269+
profile {
270+
delegate.id("nativeTest")
236271
delegate.dependencies {
237272
dependency {
238273
delegate.groupId('org.junit.platform')
@@ -246,18 +281,13 @@ publishing.publications.withType(MavenPublication) {
246281
delegate.groupId('org.springframework.boot')
247282
delegate.artifactId('spring-boot-maven-plugin')
248283
executions {
249-
execution {
250-
delegate.id('process-aot')
251-
goals {
252-
delegate.goal('process-aot')
253-
}
254-
}
255284
execution {
256285
delegate.id('process-test-aot')
257286
goals {
258287
delegate.goal('process-test-aot')
259288
}
260-
} }
289+
}
290+
}
261291
}
262292
plugin {
263293
delegate.groupId('org.graalvm.buildtools')
@@ -270,9 +300,9 @@ publishing.publications.withType(MavenPublication) {
270300
}
271301
executions {
272302
execution {
273-
delegate.id('native-build')
303+
delegate.id('native-test')
274304
goals {
275-
delegate.goal('build')
305+
delegate.goal('test')
276306
}
277307
}
278308
}

0 commit comments

Comments
 (0)