Merge branch '3.0.x' into 3.1.x

Closes gh-36972
3.1.x
Stephane Nicoll 1 year ago
commit 5f2432aca2

@ -53,6 +53,7 @@ import org.springframework.boot.maven.CommandLineBuilder.ClasspathBuilder;
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick * @author Scott Frederick
* @author Omar YAYA
* @since 3.0.0 * @since 3.0.0
*/ */
public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo {
@ -152,10 +153,16 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo {
options.add(releaseVersion); options.add(releaseVersion);
} }
else { else {
options.add("--source"); String source = compilerConfiguration.getSourceMajorVersion();
options.add(compilerConfiguration.getSourceMajorVersion()); if (source != null) {
options.add("--target"); options.add("--source");
options.add(compilerConfiguration.getTargetMajorVersion()); options.add(source);
}
String target = compilerConfiguration.getTargetMajorVersion();
if (target != null) {
options.add("--target");
options.add(target);
}
} }
options.addAll(new RunArguments(this.compilerArguments).getArgs()); options.addAll(new RunArguments(this.compilerArguments).getArgs());
Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromPaths(sourceFiles); Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromPaths(sourceFiles);

Loading…
Cancel
Save