mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Compile with Java with the '-parameters' option
Update the `ConventionsPlugin` to apply the `-parameters` compiler argument. Closes gh-19784
This commit is contained in:
parent
abad00754b
commit
0bb00c9a43
@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.boot.build;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@ -104,7 +105,13 @@ public class ConventionsPlugin implements Plugin<Project> {
|
||||
project.getPlugins().withType(JavaPlugin.class, (java) -> {
|
||||
configureSpringJavaFormat(project);
|
||||
project.setProperty("sourceCompatibility", "1.8");
|
||||
project.getTasks().withType(JavaCompile.class, (compile) -> compile.getOptions().setEncoding("UTF-8"));
|
||||
project.getTasks().withType(JavaCompile.class, (compile) -> {
|
||||
compile.getOptions().setEncoding("UTF-8");
|
||||
List<String> args = compile.getOptions().getCompilerArgs();
|
||||
if (!args.contains("-parameters")) {
|
||||
args.add("-parameters");
|
||||
}
|
||||
});
|
||||
project.getTasks().withType(Javadoc.class,
|
||||
(javadoc) -> javadoc.getOptions().source("1.8").encoding("UTF-8"));
|
||||
project.getTasks().withType(Test.class, (test) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user