From 2e373ab38d914041f0a32912bd82db8d972c7e24 Mon Sep 17 00:00:00 2001 From: Steven Schlansker Date: Mon, 18 Aug 2025 15:39:04 -0700 Subject: [PATCH] maven-plugin aot test mojo: process aot when tests are built but not run Currently, it is not possible to build the tests (with aot processing) without running them. Maven provides two different configuration switches: * skipTests builds, but does not run, tests * maven.test.skip neither builds nor runs tests Right now the spring boot aot processing will skip aot in both cases. However, there's reasons to build but not run tests: in particular, this breaks reproducible builds because the main run (with tests) has the aot classes built, but then the reproducer run (skip running tests) does not, leading to different jars. In the case where tests are built but not run, we should still do AOT processing. Signed-off-by: Steven Schlansker --- .../java/org/springframework/boot/maven/ProcessTestAotMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java index a9806a617b81..b6af363f0f5c 100644 --- a/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java +++ b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java @@ -124,7 +124,7 @@ protected void executeAot() throws Exception { getLog().debug("process-test-aot goal could not be applied to pom project."); return; } - if (Boolean.getBoolean("skipTests") || Boolean.getBoolean("maven.test.skip")) { + if (Boolean.getBoolean("maven.test.skip")) { getLog().info("Skipping AOT test processing since tests are skipped"); return; }