Fix content filters when excludeProjectDependencies() is used

Fixes gh-23763
This commit is contained in:
Andy Wilkinson
2020-10-20 13:09:59 +01:00
parent fda37ead9b
commit 0aa0cba3f7
2 changed files with 5 additions and 4 deletions

View File

@@ -369,7 +369,7 @@ public class LayeredSpec {
List<ContentFilter<Library>> excludeFilters = getExcludes().stream().map(filterFactory)
.collect(Collectors.toList());
if (this.excludeProjectDependencies) {
excludeFilters = new ArrayList<>(includeFilters);
excludeFilters = new ArrayList<>(excludeFilters);
excludeFilters.add(Library::isLocal);
}
return new IncludeExcludeContentSelector<>(layer, includeFilters, excludeFilters);

View File

@@ -19,11 +19,12 @@ bootJar {
intoLayer("app")
}
dependencies {
intoLayer("subproject-dependencies") {
includeProjectDependencies()
}
intoLayer("snapshot-dependencies") {
include "*:*:*SNAPSHOT"
excludeProjectDependencies()
}
intoLayer("subproject-dependencies") {
includeProjectDependencies()
}
intoLayer("commons-dependencies") {
include "org.apache.commons:*"