Skip to content

Commit 4a8d01d

Browse files
committed
Exclude starter POMs from lib-provided when using Gradle
Fixes gh-48195
1 parent 4625534 commit 4a8d01d

File tree

1 file changed

+3
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin

1 file changed

+3
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/WarPluginAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ private TaskProvider<BootWar> configureBootWarTask(Project project) {
8686
.minus((developmentOnly.minus(productionRuntimeClasspath)))
8787
.minus((testAndDevelopmentOnly.minus(productionRuntimeClasspath)))
8888
.filter(new JarTypeFileSpec());
89+
Callable<FileCollection> providedClasspath = () -> providedRuntimeConfiguration(project)
90+
.filter(new JarTypeFileSpec());
8991
TaskProvider<ResolveMainClassName> resolveMainClassName = project.getTasks()
9092
.named(SpringBootPlugin.RESOLVE_MAIN_CLASS_NAME_TASK_NAME, ResolveMainClassName.class);
9193
TaskProvider<BootWar> bootWarProvider = project.getTasks()
9294
.register(SpringBootPlugin.BOOT_WAR_TASK_NAME, BootWar.class, (bootWar) -> {
9395
bootWar.setGroup(BasePlugin.BUILD_GROUP);
9496
bootWar.setDescription("Assembles an executable war archive containing webapp"
9597
+ " content, and the main classes and their dependencies.");
96-
bootWar.providedClasspath(providedRuntimeConfiguration(project));
98+
bootWar.providedClasspath(providedClasspath);
9799
bootWar.setClasspath(classpath);
98100
Provider<String> manifestStartClass = project
99101
.provider(() -> (String) bootWar.getManifest().getAttributes().get("Start-Class"));

0 commit comments

Comments
 (0)