From 0308de167263d55b5c7ac89a6a4f95266c357e3e Mon Sep 17 00:00:00 2001 From: Urs Keller Date: Wed, 10 May 2023 10:21:24 +0200 Subject: [PATCH 1/2] Don't run process-aot or process-test-aot on reactor projects See gh-35377 --- .../java/org/springframework/boot/maven/AbstractAotMojo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java index 89287a2985..1c5397d377 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java @@ -97,6 +97,10 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { + if (this.project.getPackaging().equals("pom")) { + getLog().debug("process-*aot goals could not be applied to pom project."); + return; + } if (this.skip) { getLog().debug("Skipping AOT execution as per configuration"); return; From 84c1c5ccaa8abded69f411db8c4a63391590b839 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 21 Jul 2023 16:39:50 +0100 Subject: [PATCH 2/2] Polish "Don't run process-aot or process-test-aot on reactor projects" See gh-35377 --- .../org/springframework/boot/maven/AbstractAotMojo.java | 4 ---- .../java/org/springframework/boot/maven/ProcessAotMojo.java | 6 +++++- .../org/springframework/boot/maven/ProcessTestAotMojo.java | 4 ++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java index 1c5397d377..89287a2985 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java @@ -97,10 +97,6 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { - if (this.project.getPackaging().equals("pom")) { - getLog().debug("process-*aot goals could not be applied to pom project."); - return; - } if (this.skip) { getLog().debug("Skipping AOT execution as per configuration"); return; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessAotMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessAotMojo.java index 314f94510b..9f75cf1e5a 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessAotMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessAotMojo.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,6 +88,10 @@ public class ProcessAotMojo extends AbstractAotMojo { @Override protected void executeAot() throws Exception { + if (this.project.getPackaging().equals("pom")) { + getLog().debug("process-aot goal could not be applied to pom project."); + return; + } String applicationClass = (this.mainClass != null) ? this.mainClass : SpringBootApplicationClassFinder.findSingleClass(this.classesDirectory); URL[] classPath = getClassPath(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java index ea888c5992..a1b93ac3c2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/ProcessTestAotMojo.java @@ -118,6 +118,10 @@ public class ProcessTestAotMojo extends AbstractAotMojo { @Override protected void executeAot() throws Exception { + if (this.project.getPackaging().equals("pom")) { + getLog().debug("process-test-aot goal could not be applied to pom project."); + return; + } if (Boolean.getBoolean("skipTests") || Boolean.getBoolean("maven.test.skip")) { getLog().info("Skipping AOT test processing since tests are skipped"); return;