Add AOT-generated classes to classpath of the compiler
See gh-32304
This commit is contained in:
@@ -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<URL> urls = new ArrayList<>();
|
||||
urls.add(toURL(classesDirectory));
|
||||
urls.add(toURL(generatedClassesDirectory));
|
||||
urls.addAll(getDependencyURLs(artifactFilters));
|
||||
return urls.toArray(URL[]::new);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user