Browse Source

Consistently enable parameters generation with AOT

This commit updates the Maven Plugin to retain parameters information
in AOT-generated code. This aligns with the Gradle Plugin and allows
to consistently use parameter names resolution in generated code.

Closes gh-49268
pull/49366/head
Stéphane Nicoll 4 weeks ago
parent
commit
12e5cd4b45
  1. 2
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/aot-compiler-arguments/pom.xml
  2. 1
      spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java

2
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/aot-compiler-arguments/pom.xml

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
<goal>process-aot</goal>
</goals>
<configuration>
<compilerArguments>-verbose --invalid-compiler-arg</compilerArguments>
<compilerArguments>-parameters --invalid-compiler-arg</compilerArguments>
</configuration>
</execution>
</executions>

1
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractAotMojo.java

@ -168,6 +168,7 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo { @@ -168,6 +168,7 @@ public abstract class AbstractAotMojo extends AbstractDependencyFilterMojo {
args.add(target);
}
}
args.add("-parameters");
args.addAll(new RunArguments(this.compilerArguments).getArgs());
Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromPaths(sourceFiles);
Errors errors = new Errors();

Loading…
Cancel
Save