Merge branch '2.3.x'

Closes gh-24132
This commit is contained in:
Andy Wilkinson 2020-11-12 08:12:39 +00:00
commit bce2029bc6
1 changed files with 13 additions and 20 deletions

View File

@ -18,7 +18,6 @@ package org.springframework.boot.build;
import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -114,13 +113,7 @@ class JavaConventions {
.collect(Collectors.toSet());
Set<String> javadocJarTaskNames = sourceSets.stream().map(SourceSet::getJavadocJarTaskName)
.collect(Collectors.toSet());
Set<String> jarTaskNames = sourceSets.stream().map(SourceSet::getJarTaskName).collect(Collectors.toSet());
Set<String> jarTasksOfInterest = new HashSet<String>();
jarTasksOfInterest.addAll(sourceJarTaskNames);
jarTasksOfInterest.addAll(javadocJarTaskNames);
jarTasksOfInterest.addAll(jarTaskNames);
project.getTasks().matching((task) -> jarTasksOfInterest.contains(task.getName())).withType(Jar.class,
(jar) -> project.afterEvaluate((evaluated) -> {
project.getTasks().withType(Jar.class, (jar) -> project.afterEvaluate((evaluated) -> {
jar.metaInf((metaInf) -> metaInf.from(extractLegalResources));
jar.manifest((manifest) -> {
Map<String, Object> attributes = new TreeMap<>();