Skip to content

Commit 0aa0cba

Browse files
committed
Fix content filters when excludeProjectDependencies() is used
Fixes gh-23763
1 parent fda37ea commit 0aa0cba

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/LayeredSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ ContentSelector<Library> asLibrarySelector(Function<String, ContentFilter<Librar
369369
List<ContentFilter<Library>> excludeFilters = getExcludes().stream().map(filterFactory)
370370
.collect(Collectors.toList());
371371
if (this.excludeProjectDependencies) {
372-
excludeFilters = new ArrayList<>(includeFilters);
372+
excludeFilters = new ArrayList<>(excludeFilters);
373373
excludeFilters.add(Library::isLocal);
374374
}
375375
return new IncludeExcludeContentSelector<>(layer, includeFilters, excludeFilters);

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootJarIntegrationTests-multiModuleCustomLayers.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ bootJar {
1919
intoLayer("app")
2020
}
2121
dependencies {
22-
intoLayer("subproject-dependencies") {
23-
includeProjectDependencies()
24-
}
2522
intoLayer("snapshot-dependencies") {
2623
include "*:*:*SNAPSHOT"
24+
excludeProjectDependencies()
25+
}
26+
intoLayer("subproject-dependencies") {
27+
includeProjectDependencies()
2728
}
2829
intoLayer("commons-dependencies") {
2930
include "org.apache.commons:*"

0 commit comments

Comments
 (0)