Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 05458b1

Browse files
mhalbrittersnicoll
authored andcommitted
Add support for maven-compiler-plugin > 3.8.1
The maven-compiler-plugin starting from 3.9.0 removed the configuration option 'compilePath', which the TestGenerateMojo was using. This option was not used and have been removed by the maven-compiler-plugin team in commit 419bf040893dac8f300deb5b36daf5f487dea8d2 See gh-1559
1 parent 1242068 commit 05458b1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spring-aot-maven-plugin/src/main/java/org/springframework/aot/maven/TestGenerateMojo.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.apache.maven.plugins.annotations.ResolutionScope;
3939
import org.apache.maven.shared.utils.cli.CommandLineUtils;
4040
import org.codehaus.plexus.util.xml.Xpp3Dom;
41-
import org.twdata.maven.mojoexecutor.MojoExecutor;
4241

4342
import org.springframework.aot.test.build.GenerateTestBootstrapCommand;
4443
import org.springframework.util.StringUtils;
@@ -151,7 +150,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
151150

152151
forkJvm(Paths.get(this.project.getBuild().getDirectory()).toFile(), args, Collections.emptyMap());
153152

154-
compileGeneratedTestSources(sourcesPath, testClasspathElements);
153+
compileGeneratedTestSources(sourcesPath);
155154
processGeneratedTestResources(resourcesPath, Paths.get(project.getBuild().getTestOutputDirectory()));
156155

157156
// Write system property as spring.properties file in test resources.
@@ -167,13 +166,11 @@ public void execute() throws MojoExecutionException, MojoFailureException {
167166
}
168167
}
169168

170-
protected void compileGeneratedTestSources(Path sourcesPath, List<String> testClasspathElements) throws MojoExecutionException {
169+
protected void compileGeneratedTestSources(Path sourcesPath) throws MojoExecutionException {
171170
String compilerVersion = this.project.getProperties().getProperty("maven-compiler-plugin.version", DEFAULT_COMPILER_PLUGIN_VERSION);
172171
project.addTestCompileSourceRoot(sourcesPath.toString());
173172
Xpp3Dom compilerConfig = configuration(
174-
element("compileSourceRoots", element("compileSourceRoot", sourcesPath.toString())),
175-
element("compilePath", testClasspathElements.stream()
176-
.map(classpathElement -> element("compilePath", classpathElement)).toArray(MojoExecutor.Element[]::new))
173+
element("compileSourceRoots", element("compileSourceRoot", sourcesPath.toString()))
177174
);
178175
executeMojo(
179176
plugin(groupId("org.apache.maven.plugins"), artifactId("maven-compiler-plugin"), version(compilerVersion)),

0 commit comments

Comments
 (0)