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 35f33eabb0..d94305663a 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 @@ -137,10 +137,11 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { } } - protected final URL[] getClassPath(File classesDirectory, ArtifactsFilter... artifactFilters) - throws MojoExecutionException { + protected final URL[] getClassPath(File classesDirectory, File generatedClassesDirectory, + ArtifactsFilter... artifactFilters) throws MojoExecutionException { List urls = new ArrayList<>(); urls.add(toURL(classesDirectory)); + urls.add(toURL(generatedClassesDirectory)); urls.addAll(getDependencyURLs(artifactFilters)); return urls.toArray(URL[]::new); } 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 cf5d124b30..238b478ba7 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 @@ -107,7 +107,7 @@ public class ProcessAotMojo extends AbstractAotMojo { } protected URL[] getClassPath() throws Exception { - return getClassPath(this.classesDirectory, new ExcludeTestScopeArtifactFilter()); + return getClassPath(this.classesDirectory, this.generatedClasses, new ExcludeTestScopeArtifactFilter()); } } 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 423d058f6b..f4a1045370 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 @@ -133,7 +133,7 @@ public class ProcessTestAotMojo extends AbstractAotMojo { } protected URL[] getClassPath(boolean includeJUnitPlatformLauncher) throws Exception { - URL[] classPath = getClassPath(this.classesDirectory); + URL[] classPath = getClassPath(this.classesDirectory, this.generatedClasses); if (!includeJUnitPlatformLauncher || this.project.getArtifactMap() .containsKey(JUNIT_PLATFORM_GROUP_ID + ":" + JUNIT_PLATFORM_LAUNCHER_ARTIFACT_ID)) { return classPath;