|
52 | 52 | import org.gradle.api.tasks.javadoc.Javadoc; |
53 | 53 | import org.gradle.api.tasks.testing.Test; |
54 | 54 | import org.gradle.external.javadoc.CoreJavadocOptions; |
55 | | -import org.gradle.jvm.toolchain.JavaLanguageVersion; |
56 | 55 |
|
57 | 56 | import org.springframework.boot.build.SystemRequirementsExtension.JavaSpec; |
58 | 57 | import org.springframework.boot.build.architecture.ArchitecturePlugin; |
@@ -170,7 +169,7 @@ private void configureJarManifestConventions(Project project) { |
170 | 169 | jar.manifest((manifest) -> { |
171 | 170 | Map<String, Object> attributes = new TreeMap<>(); |
172 | 171 | attributes.put("Automatic-Module-Name", project.getName().replace("-", ".")); |
173 | | - attributes.put("Build-Jdk-Spec", this.javaSpec.getVersion().get().toString()); |
| 172 | + attributes.put("Build-Jdk-Spec", this.javaSpec.getVersion()); |
174 | 173 | attributes.put("Built-By", "Spring"); |
175 | 174 | attributes.put("Implementation-Title", |
176 | 175 | determineImplementationTitle(project, sourceJarTaskNames, javadocJarTaskNames, jar)); |
@@ -248,15 +247,9 @@ private void addValuelessOption(CoreJavadocOptions options, String option) { |
248 | 247 | } |
249 | 248 |
|
250 | 249 | private void configureJavaConventions(Project project) { |
251 | | - JavaLanguageVersion javaVersion = this.javaSpec.getVersion().get(); |
252 | | - if (!project.hasProperty("toolchainVersion")) { |
253 | | - JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class); |
254 | | - javaPluginExtension.setSourceCompatibility(javaVersion); |
255 | | - javaPluginExtension.setTargetCompatibility(javaVersion); |
256 | | - } |
257 | 250 | project.getTasks().withType(JavaCompile.class, (compile) -> { |
258 | 251 | compile.getOptions().setEncoding("UTF-8"); |
259 | | - compile.getOptions().getRelease().set(javaVersion.asInt()); |
| 252 | + compile.getOptions().getRelease().set(this.javaSpec.getVersion()); |
260 | 253 | List<String> args = compile.getOptions().getCompilerArgs(); |
261 | 254 | if (!args.contains("-parameters")) { |
262 | 255 | args.add("-parameters"); |
|
0 commit comments